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.

Reply via email to