[thrift] fix Ruby codegen: capitalize module name for enums
authorChristopher Piro <cpiro@apache.org>
Wed, 3 Oct 2007 07:13:44 +0000 (07:13 +0000)
committerChristopher Piro <cpiro@apache.org>
Wed, 3 Oct 2007 07:13:44 +0000 (07:13 +0000)
Summary: all module names must be capitalized in Ruby -- if the enum name from the interface isn't capitalized \
         then it's a runtime error, e.g. in fb303_types.rb:

         -module fb_status
         +module Fb_status

Reviewed By: mcslee

Test Plan: fb303 now works with Ruby binding

Revert: OK

TracCamp Project: Thrift

DiffCamp Revision: 692

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665288 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_rb_generator.cc

index 2de2ed9..edfad0f 100644 (file)
@@ -105,7 +105,7 @@ void t_rb_generator::generate_typedef(t_typedef* ttypedef) {}
  */
 void t_rb_generator::generate_enum(t_enum* tenum) {
   indent(f_types_) <<
-    "module " << tenum->get_name() << endl;
+    "module " << capitalize(tenum->get_name()) << endl;
   indent_up();
   
   vector<t_enum_value*> constants = tenum->get_constants();