From: Christopher Piro Date: Wed, 3 Oct 2007 07:13:44 +0000 (+0000) Subject: [thrift] fix Ruby codegen: capitalize module name for enums X-Git-Tag: 0.2.0~1184 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=73e3dd7d5fdd30301816982d2cd6a961380538ac;p=common%2Fthrift.git [thrift] fix Ruby codegen: capitalize module name for enums 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 --- diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc index 2de2ed93..edfad0fb 100644 --- a/compiler/cpp/src/generate/t_rb_generator.cc +++ b/compiler/cpp/src/generate/t_rb_generator.cc @@ -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 constants = tenum->get_constants();