THRIFT-332. rb: Compact Protocol in Ruby

This patch includes both a pure Ruby and C-extension port of the Compact Protocol described in THRIFT-110. It also fixes a bug in struct.c that was interfering with native protocol method calls, and adds some utility classes to the Java library for serializing/deserializing to a file for the purpose of testing protocols cross-language.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756133 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/struct_spec.rb b/lib/rb/spec/struct_spec.rb
index 1a22f57..1eda3c3 100644
--- a/lib/rb/spec/struct_spec.rb
+++ b/lib/rb/spec/struct_spec.rb
@@ -10,16 +10,8 @@
   describe Struct do
     it "should iterate over all fields properly" do
       fields = {}
-      Foo.new.each_field { |fid,type,name,default,optional| fields[fid] = [type,name,default,optional] }
-      fields.should == {
-        1 => [Types::I32, 'simple', 53, nil],
-        2 => [Types::STRING, 'words', "words", nil],
-        3 => [Types::STRUCT, 'hello', Hello.new(:greeting => 'hello, world!'), nil],
-        4 => [Types::LIST, 'ints', [1, 2, 2, 3], nil],
-        5 => [Types::MAP, 'complex', nil, nil],
-        6 => [Types::SET, 'shorts', Set.new([5, 17, 239]), nil],
-        7 => [Types::STRING, 'opt_string', nil, true]
-      }
+      Foo.new.each_field { |fid,field_info| fields[fid] = field_info }
+      fields.should == Foo::FIELDS
     end
 
     it "should initialize all fields to defaults" do