Thrift-2960: Fix namespace regression for Ruby
Client: rb
Patch: Jan Brauer
Add test that exposes the broken namespacing.
Fixes a bug introduced by #140.
This closes #363
diff --git a/lib/rb/Rakefile b/lib/rb/Rakefile
index ef00a9f..8f1c4fe 100644
--- a/lib/rb/Rakefile
+++ b/lib/rb/Rakefile
@@ -38,7 +38,7 @@
end
desc 'Compile the .thrift files for the specs'
-task :'gen-rb' => [:'gen-rb:spec', :'gen-rb:namespaced_spec', :'gen-rb:benchmark', :'gen-rb:debug_proto']
+task :'gen-rb' => [:'gen-rb:spec', :'gen-rb:namespaced_spec', :'gen-rb:flat_spec', :'gen-rb:benchmark', :'gen-rb:debug_proto']
namespace :'gen-rb' do
task :'spec' do
dir = File.dirname(__FILE__) + '/spec'
@@ -50,6 +50,12 @@
sh THRIFT, '--gen', 'rb:namespaced', '-recurse', '-o', dir, "#{dir}/ThriftNamespacedSpec.thrift"
end
+ task :'flat_spec' do
+ dir = File.dirname(__FILE__) + '/spec'
+ mkdir_p("#{dir}/gen-rb/flat")
+ sh THRIFT, '--gen', 'rb', '-recurse', '-out', "#{dir}/gen-rb/flat", "#{dir}/ThriftNamespacedSpec.thrift"
+ end
+
task :'benchmark' do
dir = File.dirname(__FILE__) + '/benchmark'
sh THRIFT, '--gen', 'rb', '-o', dir, "#{dir}/Benchmark.thrift"