Lots of Ruby code generation improvements

Summary: Submitted by Kevin Clark, Ruby guru from Powerset

Reviewed By: mcslee

Test Plan: He updated the tests in trunk/test/rb/

Notes: The code is now officially "ruby-ish" and idiomatic


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665151 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index 23b9fa0..fe64e85 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -79,6 +79,7 @@
 %token tok_xsd_nillable
 %token tok_xsd_namespace
 %token tok_xsd_attrs
+%token tok_ruby_namespace
 
 /**
  * Base datatype keywords
@@ -234,6 +235,13 @@
         g_program->set_php_namespace($2);
       }
     }
+| tok_ruby_namespace tok_identifier
+    {
+      pdebug("Header -> tok_ruby_namespace tok_identifier");
+      if (g_parse_mode == PROGRAM) {
+        g_program->set_ruby_namespace($2);
+      }
+    }
 | tok_java_package tok_identifier
     {
       pdebug("Header -> tok_java_package tok_identifier");