You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Dave Engberg (JIRA)" <ji...@apache.org> on 2008/10/05 09:09:44 UTC

[jira] Updated: (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:all-tabpanel ]

Dave Engberg updated THRIFT-157:
--------------------------------

    Attachment: t_rb_generator.cc.diff

> 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
>            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.