Thrift-THRIFT-2574: Compiler option to generate namespace directories for Ruby
Client: rb
Patch: Andrew Bloomgarden

Adds option to generate namespaced ruby classes.

Github: closes #140
diff --git a/lib/rb/Rakefile b/lib/rb/Rakefile
index f533d06..ef00a9f 100644
--- a/lib/rb/Rakefile
+++ b/lib/rb/Rakefile
@@ -38,13 +38,18 @@
 end
 
 desc 'Compile the .thrift files for the specs'
-task :'gen-rb' => [:'gen-rb:spec', :'gen-rb:benchmark', :'gen-rb:debug_proto']
+task :'gen-rb' => [:'gen-rb:spec', :'gen-rb:namespaced_spec', :'gen-rb:benchmark', :'gen-rb:debug_proto']
 namespace :'gen-rb' do
   task :'spec' do
     dir = File.dirname(__FILE__) + '/spec'
     sh THRIFT, '--gen', 'rb', '-o', dir, "#{dir}/ThriftSpec.thrift"
   end
 
+  task :'namespaced_spec' do
+    dir = File.dirname(__FILE__) + '/spec'
+    sh THRIFT, '--gen', 'rb:namespaced', '-recurse', '-o', dir, "#{dir}/ThriftNamespacedSpec.thrift"
+  end
+
   task :'benchmark' do
     dir = File.dirname(__FILE__) + '/benchmark'
     sh THRIFT, '--gen', 'rb', '-o', dir, "#{dir}/Benchmark.thrift"