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/script/write_struct.rb b/lib/rb/script/write_struct.rb
new file mode 100644
index 0000000..28010ac
--- /dev/null
+++ b/lib/rb/script/write_struct.rb
@@ -0,0 +1,12 @@
+require "spec/spec_helper"
+require "lib/thrift/serializer"
+
+path, factory_class = ARGV
+
+factory = eval(factory_class).new
+
+ser = Thrift::Serializer.new(factory)
+
+File.open(path, "w") do |file|
+  file.write(ser.serialize(Fixtures::COMPACT_PROTOCOL_TEST_STRUCT))
+end
\ No newline at end of file