rb: require 'thrift' first in generated service definitions [THRIFT-38]

From kevin@rapleaf.com


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670979 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 4336f65..786c9cd 100644
--- a/compiler/cpp/src/generate/t_rb_generator.cc
+++ b/compiler/cpp/src/generate/t_rb_generator.cc
@@ -581,6 +581,7 @@
 
   f_service_ <<
     rb_autogen_comment() << endl <<
+    "require 'thrift'" << endl <<
     rb_imports() << endl;
 
   if (tservice->get_extends() != NULL) {
@@ -589,7 +590,6 @@
   }
 
   f_service_ <<
-    "require 'thrift'" << endl <<
     "require '" << program_name_ << "_types'" << endl <<
     endl;
 
diff --git a/lib/rb/benchmark/gen-rb/BenchmarkService.rb b/lib/rb/benchmark/gen-rb/BenchmarkService.rb
index ff4b10a..c66f8c0 100644
--- a/lib/rb/benchmark/gen-rb/BenchmarkService.rb
+++ b/lib/rb/benchmark/gen-rb/BenchmarkService.rb
@@ -4,8 +4,8 @@
 # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 #
 
-require 'thrift/protocol'
 require 'thrift'
+require 'thrift/protocol'
 require 'Benchmark_types'
 
     module ThriftBenchmark
diff --git a/lib/rb/spec/gen-rb/NonblockingService.rb b/lib/rb/spec/gen-rb/NonblockingService.rb
index ba6b3e4..43273ec 100644
--- a/lib/rb/spec/gen-rb/NonblockingService.rb
+++ b/lib/rb/spec/gen-rb/NonblockingService.rb
@@ -4,8 +4,8 @@
 # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 #
 
-require 'thrift/protocol'
 require 'thrift'
+require 'thrift/protocol'
 require 'ThriftSpec_types'
 
     module SpecNamespace