You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2009/01/05 18:43:44 UTC
[jira] Commented: (THRIFT-157) Ruby generator produces incorrect
output for strings with single-quotes or for class references across
namespaces
[ https://issues.apache.org/jira/browse/THRIFT-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660829#action_12660829 ]
Bryan Duxbury commented on THRIFT-157:
--------------------------------------
I hate to see this patch languishing here. Can we just apply the patch and close the other associated issue?
> Ruby generator produces incorrect output for strings with single-quotes or for class references across namespaces
> -----------------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-157
> URL: https://issues.apache.org/jira/browse/THRIFT-157
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (Ruby)
> Reporter: Dave Engberg
> Attachments: t_rb_generator.cc.diff
>
>
> If I declare a constant in a Thrift iDL like this:
> const string HAMMER_TIME = "Can't touch this";
> The generated Ruby sources generate a constant like this:
> HAMMER_TIME = 'Can't touch this';
> This doesn't work because the apostrophe terminates the string constant. The patch replaces this with:
> HAMMER_TYPE = %q"Can't touch this";
> Which avoids the problem.
> The Ruby generator also fails to fully qualify class names when a structure or service in one Thrift-generated namespace references one in another namespace, either as a structure referenced in a structure or as an exception references in a service.
> The patch fixes the Ruby generator by adding a generator method to emit a fully qualified name, and then uses this in the two relevant places that I found which need it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.