THRIFT-276. rb: Ruby libraries should have one class per file
This monster of a patch moves all the classes into their own files and specs as appropriate. Additionally, it concentrates all the requires into thrift.rb, removing the need to require any other file. (Changes were made to the compiler to reflect this reduced requirement.)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761849 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/benchmark/benchmark.rb b/lib/rb/benchmark/benchmark.rb
index f5fe323..3dc67dd 100644
--- a/lib/rb/benchmark/benchmark.rb
+++ b/lib/rb/benchmark/benchmark.rb
@@ -20,8 +20,6 @@
require 'rubygems'
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'thrift'
-require 'thrift/server/nonblockingserver'
-require 'thrift/transport/unixsocket'
require 'stringio'
HOST = '127.0.0.1'
diff --git a/lib/rb/benchmark/client.rb b/lib/rb/benchmark/client.rb
index bd92bde..948f08d 100644
--- a/lib/rb/benchmark/client.rb
+++ b/lib/rb/benchmark/client.rb
@@ -19,7 +19,6 @@
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'thrift'
-require 'thrift/server/nonblockingserver'
$:.unshift File.dirname(__FILE__) + "/gen-rb"
require 'BenchmarkService'
diff --git a/lib/rb/benchmark/server.rb b/lib/rb/benchmark/server.rb
index 5b7da7e..d44fa88 100644
--- a/lib/rb/benchmark/server.rb
+++ b/lib/rb/benchmark/server.rb
@@ -19,7 +19,6 @@
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'thrift'
-require 'thrift/server/nonblockingserver'
$:.unshift File.dirname(__FILE__) + "/gen-rb"
require 'BenchmarkService'
@@ -41,8 +40,8 @@
handler = BenchmarkHandler.new
processor = ThriftBenchmark::BenchmarkService::Processor.new(handler)
transport = ServerSocket.new(host, port)
- transportFactory = FramedTransportFactory.new
- args = [processor, transport, transportFactory, nil, 20]
+ transport_factory = FramedTransportFactory.new
+ args = [processor, transport, transport_factory, nil, 20]
if serverClass == NonblockingServer
logger = Logger.new(STDERR)
logger.level = Logger::WARN
diff --git a/lib/rb/benchmark/thin_server.rb b/lib/rb/benchmark/thin_server.rb
index ab8db9f..47126ad 100644
--- a/lib/rb/benchmark/thin_server.rb
+++ b/lib/rb/benchmark/thin_server.rb
@@ -19,7 +19,6 @@
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'thrift'
-require 'thrift/server/nonblockingserver'
$:.unshift File.dirname(__FILE__) + "/gen-rb"
require 'BenchmarkService'
HOST = 'localhost'
@@ -39,7 +38,7 @@
handler = BenchmarkHandler.new
processor = ThriftBenchmark::BenchmarkService::Processor.new(handler)
transport = Thrift::ServerSocket.new(HOST, PORT)
-transportFactory = Thrift::FramedTransportFactory.new
+transport_factory = Thrift::FramedTransportFactory.new
logger = Logger.new(STDERR)
logger.level = Logger::WARN
-Thrift::NonblockingServer.new(processor, transport, transportFactory, nil, 20, logger).serve
+Thrift::NonblockingServer.new(processor, transport, transport_factory, nil, 20, logger).serve