You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by kc...@apache.org on 2008/06/26 19:49:49 UTC

svn commit: r671963 - in /incubator/thrift/trunk: compiler/cpp/src/generate/ lib/rb/benchmark/gen-rb/ lib/rb/spec/ lib/rb/spec/gen-rb/

Author: kclark
Date: Thu Jun 26 10:49:49 2008
New Revision: 671963

URL: http://svn.apache.org/viewvc?rev=671963&view=rev
Log:
rb: Use File.dirname(__FILE__) in generated requires [THRIFT-57]

This means you no longer have to put the gen-rb folder in $:

Author: Kevin Ballard <ke...@rapleaf.com>

Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc
    incubator/thrift/trunk/lib/rb/benchmark/gen-rb/BenchmarkService.rb
    incubator/thrift/trunk/lib/rb/benchmark/gen-rb/Benchmark_constants.rb
    incubator/thrift/trunk/lib/rb/spec/gen-rb/NonblockingService.rb
    incubator/thrift/trunk/lib/rb/spec/gen-rb/ThriftSpec_constants.rb
    incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb
    incubator/thrift/trunk/lib/rb/spec/serializer_spec.rb
    incubator/thrift/trunk/lib/rb/spec/spec_helper.rb
    incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
    incubator/thrift/trunk/lib/rb/spec/types_spec.rb

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc Thu Jun 26 10:49:49 2008
@@ -205,7 +205,7 @@
   f_consts_ <<
     rb_autogen_comment() << endl <<
     rb_imports() << endl <<
-    "require '" << program_name_ << "_types'" << endl <<
+    "require File.dirname(__FILE__) + '/" << program_name_ << "_types'" << endl <<
     endl;
     begin_namespace(f_consts_, ruby_modules(program_));
 
@@ -218,7 +218,7 @@
   const vector<t_program*>& includes = program_->get_includes();
   string result = "";
   for (size_t i = 0; i < includes.size(); ++i) {
-    result += "require '" + includes[i]->get_name() + "_types'\n";
+    result += "require File.dirname(__FILE__) + '/" + includes[i]->get_name() + "_types'\n";
   }
   if (includes.size() > 0) {
     result += "\n";
@@ -590,7 +590,7 @@
   }
 
   f_service_ <<
-    "require '" << program_name_ << "_types'" << endl <<
+    "require File.dirname(__FILE__) + '/" << program_name_ << "_types'" << endl <<
     endl;
 
   begin_namespace(f_service_, ruby_modules(tservice->get_program()));

Modified: incubator/thrift/trunk/lib/rb/benchmark/gen-rb/BenchmarkService.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/benchmark/gen-rb/BenchmarkService.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/benchmark/gen-rb/BenchmarkService.rb (original)
+++ incubator/thrift/trunk/lib/rb/benchmark/gen-rb/BenchmarkService.rb Thu Jun 26 10:49:49 2008
@@ -6,7 +6,7 @@
 
 require 'thrift'
 require 'thrift/protocol'
-require 'Benchmark_types'
+require File.dirname(__FILE__) + '/Benchmark_types'
 
     module ThriftBenchmark
       module BenchmarkService

Modified: incubator/thrift/trunk/lib/rb/benchmark/gen-rb/Benchmark_constants.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/benchmark/gen-rb/Benchmark_constants.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/benchmark/gen-rb/Benchmark_constants.rb (original)
+++ incubator/thrift/trunk/lib/rb/benchmark/gen-rb/Benchmark_constants.rb Thu Jun 26 10:49:49 2008
@@ -5,7 +5,7 @@
 #
 
 require 'thrift/protocol'
-require 'Benchmark_types'
+require File.dirname(__FILE__) + '/Benchmark_types'
 
   module ThriftBenchmark
 end

Modified: incubator/thrift/trunk/lib/rb/spec/gen-rb/NonblockingService.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/gen-rb/NonblockingService.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/gen-rb/NonblockingService.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/gen-rb/NonblockingService.rb Thu Jun 26 10:49:49 2008
@@ -6,7 +6,7 @@
 
 require 'thrift'
 require 'thrift/protocol'
-require 'ThriftSpec_types'
+require File.dirname(__FILE__) + '/ThriftSpec_types'
 
     module SpecNamespace
       module NonblockingService

Modified: incubator/thrift/trunk/lib/rb/spec/gen-rb/ThriftSpec_constants.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/gen-rb/ThriftSpec_constants.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/gen-rb/ThriftSpec_constants.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/gen-rb/ThriftSpec_constants.rb Thu Jun 26 10:49:49 2008
@@ -5,7 +5,7 @@
 #
 
 require 'thrift/protocol'
-require 'ThriftSpec_types'
+require File.dirname(__FILE__) + '/ThriftSpec_types'
 
   module SpecNamespace
 end

Modified: incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb Thu Jun 26 10:49:49 2008
@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/spec_helper'
 require 'thrift/server/nonblockingserver'
-require 'NonblockingService'
+require File.dirname(__FILE__) + '/gen-rb/NonblockingService'
 
 class ThriftNonblockingServerSpec < Spec::ExampleGroup
   include Thrift

Modified: incubator/thrift/trunk/lib/rb/spec/serializer_spec.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/serializer_spec.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/serializer_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/serializer_spec.rb Thu Jun 26 10:49:49 2008
@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/spec_helper'
 require 'thrift/serializer'
-require 'ThriftSpec_types'
+require File.dirname(__FILE__) + '/gen-rb/ThriftSpec_types'
 
 class ThriftSerializerSpec < Spec::ExampleGroup
   include Thrift

Modified: incubator/thrift/trunk/lib/rb/spec/spec_helper.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/spec_helper.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/spec_helper.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/spec_helper.rb Thu Jun 26 10:49:49 2008
@@ -13,7 +13,6 @@
 end
 
 require File.dirname(__FILE__) + '/../lib/thrift'
-$:.unshift File.dirname(__FILE__) + "/gen-rb"
 
 class Object
   # tee is a useful method, so let's let our tests have it

Modified: incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/struct_spec.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/struct_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/struct_spec.rb Thu Jun 26 10:49:49 2008
@@ -1,5 +1,5 @@
 require File.dirname(__FILE__) + '/spec_helper'
-require "ThriftSpec_types"
+require File.dirname(__FILE__) + '/gen-rb/ThriftSpec_types'
 
 class ThriftStructSpec < Spec::ExampleGroup
   include Thrift

Modified: incubator/thrift/trunk/lib/rb/spec/types_spec.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/types_spec.rb?rev=671963&r1=671962&r2=671963&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/types_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/types_spec.rb Thu Jun 26 10:49:49 2008
@@ -1,5 +1,5 @@
 require File.dirname(__FILE__) + '/spec_helper'
-require 'ThriftSpec_types'
+require File.dirname(__FILE__) + '/gen-rb/ThriftSpec_types'
 
 class ThriftTypesSpec < Spec::ExampleGroup
   include Thrift