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/spec/serializer_spec.rb b/lib/rb/spec/serializer_spec.rb
index 3411c53..db52133 100644
--- a/lib/rb/spec/serializer_spec.rb
+++ b/lib/rb/spec/serializer_spec.rb
@@ -18,7 +18,6 @@
 #
 
 require File.dirname(__FILE__) + '/spec_helper'
-require 'thrift/serializer'
 require File.dirname(__FILE__) + '/gen-rb/ThriftSpec_types'
 
 class ThriftSerializerSpec < Spec::ExampleGroup
@@ -33,16 +32,16 @@
     end
 
     it "should serialize structs to the given protocol" do
-      protocol = Protocol.new(mock("transport"))
+      protocol = BaseProtocol.new(mock("transport"))
       protocol.should_receive(:write_struct_begin).with("SpecNamespace::Hello")
       protocol.should_receive(:write_field_begin).with("greeting", Types::STRING, 1)
       protocol.should_receive(:write_string).with("Good day")
       protocol.should_receive(:write_field_end)
       protocol.should_receive(:write_field_stop)
       protocol.should_receive(:write_struct_end)
-      protocolFactory = mock("ProtocolFactory")
-      protocolFactory.stub!(:get_protocol).and_return(protocol)
-      serializer = Serializer.new(protocolFactory)
+      protocol_factory = mock("ProtocolFactory")
+      protocol_factory.stub!(:get_protocol).and_return(protocol)
+      serializer = Serializer.new(protocol_factory)
       serializer.serialize(Hello.new(:greeting => "Good day"))
     end
   end
@@ -55,16 +54,16 @@
     end
 
     it "should deserialize structs from the given protocol" do
-      protocol = Protocol.new(mock("transport"))
+      protocol = BaseProtocol.new(mock("transport"))
       protocol.should_receive(:read_struct_begin).and_return("SpecNamespace::Hello")
       protocol.should_receive(:read_field_begin).and_return(["greeting", Types::STRING, 1],
                                                             [nil, Types::STOP, 0])
       protocol.should_receive(:read_string).and_return("Good day")
       protocol.should_receive(:read_field_end)
       protocol.should_receive(:read_struct_end)
-      protocolFactory = mock("ProtocolFactory")
-      protocolFactory.stub!(:get_protocol).and_return(protocol)
-      deserializer = Deserializer.new(protocolFactory)
+      protocol_factory = mock("ProtocolFactory")
+      protocol_factory.stub!(:get_protocol).and_return(protocol)
+      deserializer = Deserializer.new(protocol_factory)
       deserializer.deserialize(Hello.new, "").should == Hello.new(:greeting => "Good day")
     end
   end