From c289608e1928cc8c6db482aafe7262a428b6f32e Mon Sep 17 00:00:00 2001 From: Kevin Clark Date: Wed, 4 Mar 2009 21:32:54 +0000 Subject: [PATCH] THRIFT-353. rb: Capitalize module names on ruby generation git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@750160 13f79535-47bb-0310-9956-ffa450edef68 --- compiler/cpp/src/generate/t_rb_generator.cc | 2 +- lib/rb/benchmark/gen-rb/BenchmarkService.rb | 8 +++---- lib/rb/spec/gen-rb/NonblockingService.rb | 24 ++++++++++----------- lib/rb/spec/gen-rb/ThriftSpec_types.rb | 10 ++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc index ee859535..da9544f3 100644 --- a/compiler/cpp/src/generate/t_rb_generator.cc +++ b/compiler/cpp/src/generate/t_rb_generator.cc @@ -638,7 +638,7 @@ void t_rb_generator::generate_service(t_service* tservice) { begin_namespace(f_service_, ruby_modules(tservice->get_program())); - indent(f_service_) << "module " << tservice->get_name() << endl; + indent(f_service_) << "module " << capitalize(tservice->get_name()) << endl; indent_up(); // Generate the three main parts of the service (well, two for now in PHP) diff --git a/lib/rb/benchmark/gen-rb/BenchmarkService.rb b/lib/rb/benchmark/gen-rb/BenchmarkService.rb index 832098b5..84e7b318 100644 --- a/lib/rb/benchmark/gen-rb/BenchmarkService.rb +++ b/lib/rb/benchmark/gen-rb/BenchmarkService.rb @@ -11,7 +11,7 @@ require File.dirname(__FILE__) + '/Benchmark_types' module ThriftBenchmark module BenchmarkService class Client - include Thrift::Client + include ::Thrift::Client def fibonacci(n) send_fibonacci(n) @@ -31,7 +31,7 @@ require File.dirname(__FILE__) + '/Benchmark_types' end class Processor - include Thrift::Processor + include ::Thrift::Processor def process_fibonacci(seqid, iprot, oprot) args = read_args(iprot, Fibonacci_args) @@ -45,7 +45,7 @@ require File.dirname(__FILE__) + '/Benchmark_types' # HELPER FUNCTIONS AND STRUCTURES class Fibonacci_args - include Thrift::Struct + include ::Thrift::Struct N = 1 Thrift::Struct.field_accessor self, :n @@ -61,7 +61,7 @@ require File.dirname(__FILE__) + '/Benchmark_types' end class Fibonacci_result - include Thrift::Struct + include ::Thrift::Struct SUCCESS = 0 Thrift::Struct.field_accessor self, :success diff --git a/lib/rb/spec/gen-rb/NonblockingService.rb b/lib/rb/spec/gen-rb/NonblockingService.rb index 3b49fce1..c588604d 100644 --- a/lib/rb/spec/gen-rb/NonblockingService.rb +++ b/lib/rb/spec/gen-rb/NonblockingService.rb @@ -11,7 +11,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' module SpecNamespace module NonblockingService class Client - include Thrift::Client + include ::Thrift::Client def greeting(english) send_greeting(english) @@ -74,7 +74,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Processor - include Thrift::Processor + include ::Thrift::Processor def process_greeting(seqid, iprot, oprot) args = read_args(iprot, Greeting_args) @@ -114,7 +114,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' # HELPER FUNCTIONS AND STRUCTURES class Greeting_args - include Thrift::Struct + include ::Thrift::Struct ENGLISH = 1 Thrift::Struct.field_accessor self, :english @@ -130,7 +130,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Greeting_result - include Thrift::Struct + include ::Thrift::Struct SUCCESS = 0 Thrift::Struct.field_accessor self, :success @@ -146,7 +146,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Block_args - include Thrift::Struct + include ::Thrift::Struct FIELDS = { @@ -160,7 +160,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Block_result - include Thrift::Struct + include ::Thrift::Struct SUCCESS = 0 Thrift::Struct.field_accessor self, :success @@ -176,7 +176,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Unblock_args - include Thrift::Struct + include ::Thrift::Struct N = 1 Thrift::Struct.field_accessor self, :n @@ -192,7 +192,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Unblock_result - include Thrift::Struct + include ::Thrift::Struct FIELDS = { @@ -206,7 +206,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Shutdown_args - include Thrift::Struct + include ::Thrift::Struct FIELDS = { @@ -220,7 +220,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Shutdown_result - include Thrift::Struct + include ::Thrift::Struct FIELDS = { @@ -234,7 +234,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Sleep_args - include Thrift::Struct + include ::Thrift::Struct SECONDS = 1 Thrift::Struct.field_accessor self, :seconds @@ -250,7 +250,7 @@ require File.dirname(__FILE__) + '/ThriftSpec_types' end class Sleep_result - include Thrift::Struct + include ::Thrift::Struct FIELDS = { diff --git a/lib/rb/spec/gen-rb/ThriftSpec_types.rb b/lib/rb/spec/gen-rb/ThriftSpec_types.rb index ea73af12..f9d75266 100644 --- a/lib/rb/spec/gen-rb/ThriftSpec_types.rb +++ b/lib/rb/spec/gen-rb/ThriftSpec_types.rb @@ -8,7 +8,7 @@ require 'thrift/protocol' module SpecNamespace class Hello - include Thrift::Struct + include ::Thrift::Struct GREETING = 1 Thrift::Struct.field_accessor self, :greeting @@ -24,7 +24,7 @@ module SpecNamespace end class Foo - include Thrift::Struct + include ::Thrift::Struct SIMPLE = 1 WORDS = 2 HELLO = 3 @@ -62,7 +62,7 @@ module SpecNamespace end class BoolStruct - include Thrift::Struct + include ::Thrift::Struct YESNO = 1 Thrift::Struct.field_accessor self, :yesno @@ -78,7 +78,7 @@ module SpecNamespace end class SimpleList - include Thrift::Struct + include ::Thrift::Struct BOOLS = 1 BYTES = 2 I16S = 3 @@ -114,7 +114,7 @@ module SpecNamespace end class Xception < Thrift::Exception - include Thrift::Struct + include ::Thrift::Struct MESSAGE = 1 CODE = 2 -- 2.17.1