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/struct_spec.rb b/lib/rb/spec/struct_spec.rb
index 69826e7..bfcf0ea 100644
--- a/lib/rb/spec/struct_spec.rb
+++ b/lib/rb/spec/struct_spec.rb
@@ -20,8 +20,6 @@
 require File.dirname(__FILE__) + '/spec_helper'
 require File.dirname(__FILE__) + '/gen-rb/ThriftSpec_types'
 
-# require "binaryprotocolaccelerated"
-
 class ThriftStructSpec < Spec::ExampleGroup
   include Thrift
   include SpecNamespace
@@ -67,7 +65,7 @@
 
     it "should read itself off the wire" do
       struct = Foo.new
-      prot = Protocol.new(mock("transport"))
+      prot = BaseProtocol.new(mock("transport"))
       prot.should_receive(:read_struct_begin).twice
       prot.should_receive(:read_struct_end).twice
       prot.should_receive(:read_field_begin).and_return(
@@ -113,7 +111,7 @@
 
     it "should skip unexpected fields in structs and use default values" do
       struct = Foo.new
-      prot = Protocol.new(mock("transport"))
+      prot = BaseProtocol.new(mock("transport"))
       prot.should_receive(:read_struct_begin)
       prot.should_receive(:read_struct_end)
       prot.should_receive(:read_field_begin).and_return(
@@ -143,7 +141,7 @@
     end
 
     it "should write itself to the wire" do
-      prot = Protocol.new(mock("transport")) #mock("Protocol")
+      prot = BaseProtocol.new(mock("transport")) #mock("Protocol")
       prot.should_receive(:write_struct_begin).with("SpecNamespace::Foo")
       prot.should_receive(:write_struct_begin).with("SpecNamespace::Hello")
       prot.should_receive(:write_struct_end).twice
@@ -218,7 +216,7 @@
         e.message.should == "something happened"
         e.code.should == 1
         # ensure it gets serialized properly, this is the really important part
-        prot = Protocol.new(mock("trans"))
+        prot = BaseProtocol.new(mock("trans"))
         prot.should_receive(:write_struct_begin).with("SpecNamespace::Xception")
         prot.should_receive(:write_struct_end)
         prot.should_receive(:write_field_begin).with('message', Types::STRING, 1)#, "something happened")
@@ -238,7 +236,7 @@
       rescue Thrift::Exception => e
         e.message.should == "something happened"
         e.code.should == 5
-        prot = Protocol.new(mock("trans"))
+        prot = BaseProtocol.new(mock("trans"))
         prot.should_receive(:write_struct_begin).with("SpecNamespace::Xception")
         prot.should_receive(:write_struct_end)
         prot.should_receive(:write_field_begin).with('message', Types::STRING, 1)