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
diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc
index ee85953..da9544f 100644
--- a/compiler/cpp/src/generate/t_rb_generator.cc
+++ b/compiler/cpp/src/generate/t_rb_generator.cc
@@ -638,7 +638,7 @@
 
   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 832098b..84e7b31 100644
--- a/lib/rb/benchmark/gen-rb/BenchmarkService.rb
+++ b/lib/rb/benchmark/gen-rb/BenchmarkService.rb
@@ -11,7 +11,7 @@
     module ThriftBenchmark
       module BenchmarkService
         class Client
-          include Thrift::Client
+          include ::Thrift::Client
 
           def fibonacci(n)
             send_fibonacci(n)
@@ -31,7 +31,7 @@
         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 @@
         # 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 @@
         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 3b49fce..c588604 100644
--- a/lib/rb/spec/gen-rb/NonblockingService.rb
+++ b/lib/rb/spec/gen-rb/NonblockingService.rb
@@ -11,7 +11,7 @@
     module SpecNamespace
       module NonblockingService
         class Client
-          include Thrift::Client
+          include ::Thrift::Client
 
           def greeting(english)
             send_greeting(english)
@@ -74,7 +74,7 @@
         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 @@
         # 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 @@
         end
 
         class Greeting_result
-          include Thrift::Struct
+          include ::Thrift::Struct
           SUCCESS = 0
 
           Thrift::Struct.field_accessor self, :success
@@ -146,7 +146,7 @@
         end
 
         class Block_args
-          include Thrift::Struct
+          include ::Thrift::Struct
 
           FIELDS = {
 
@@ -160,7 +160,7 @@
         end
 
         class Block_result
-          include Thrift::Struct
+          include ::Thrift::Struct
           SUCCESS = 0
 
           Thrift::Struct.field_accessor self, :success
@@ -176,7 +176,7 @@
         end
 
         class Unblock_args
-          include Thrift::Struct
+          include ::Thrift::Struct
           N = 1
 
           Thrift::Struct.field_accessor self, :n
@@ -192,7 +192,7 @@
         end
 
         class Unblock_result
-          include Thrift::Struct
+          include ::Thrift::Struct
 
           FIELDS = {
 
@@ -206,7 +206,7 @@
         end
 
         class Shutdown_args
-          include Thrift::Struct
+          include ::Thrift::Struct
 
           FIELDS = {
 
@@ -220,7 +220,7 @@
         end
 
         class Shutdown_result
-          include Thrift::Struct
+          include ::Thrift::Struct
 
           FIELDS = {
 
@@ -234,7 +234,7 @@
         end
 
         class Sleep_args
-          include Thrift::Struct
+          include ::Thrift::Struct
           SECONDS = 1
 
           Thrift::Struct.field_accessor self, :seconds
@@ -250,7 +250,7 @@
         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 ea73af1..f9d7526 100644
--- a/lib/rb/spec/gen-rb/ThriftSpec_types.rb
+++ b/lib/rb/spec/gen-rb/ThriftSpec_types.rb
@@ -8,7 +8,7 @@
 
 module SpecNamespace
     class Hello
-      include Thrift::Struct
+      include ::Thrift::Struct
       GREETING = 1
 
       Thrift::Struct.field_accessor self, :greeting
@@ -24,7 +24,7 @@
     end
 
     class Foo
-      include Thrift::Struct
+      include ::Thrift::Struct
       SIMPLE = 1
       WORDS = 2
       HELLO = 3
@@ -62,7 +62,7 @@
     end
 
     class BoolStruct
-      include Thrift::Struct
+      include ::Thrift::Struct
       YESNO = 1
 
       Thrift::Struct.field_accessor self, :yesno
@@ -78,7 +78,7 @@
     end
 
     class SimpleList
-      include Thrift::Struct
+      include ::Thrift::Struct
       BOOLS = 1
       BYTES = 2
       I16S = 3
@@ -114,7 +114,7 @@
     end
 
     class Xception < Thrift::Exception
-      include Thrift::Struct
+      include ::Thrift::Struct
       MESSAGE = 1
       CODE = 2