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 <kevin@rapleaf.com>
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@671963 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/benchmark/gen-rb/BenchmarkService.rb b/lib/rb/benchmark/gen-rb/BenchmarkService.rb
index c66f8c0..42c8aec 100644
--- a/lib/rb/benchmark/gen-rb/BenchmarkService.rb
+++ b/lib/rb/benchmark/gen-rb/BenchmarkService.rb
@@ -6,7 +6,7 @@
require 'thrift'
require 'thrift/protocol'
-require 'Benchmark_types'
+require File.dirname(__FILE__) + '/Benchmark_types'
module ThriftBenchmark
module BenchmarkService
diff --git a/lib/rb/benchmark/gen-rb/Benchmark_constants.rb b/lib/rb/benchmark/gen-rb/Benchmark_constants.rb
index a183531..33cfbe9 100644
--- a/lib/rb/benchmark/gen-rb/Benchmark_constants.rb
+++ b/lib/rb/benchmark/gen-rb/Benchmark_constants.rb
@@ -5,7 +5,7 @@
#
require 'thrift/protocol'
-require 'Benchmark_types'
+require File.dirname(__FILE__) + '/Benchmark_types'
module ThriftBenchmark
end
diff --git a/lib/rb/spec/gen-rb/NonblockingService.rb b/lib/rb/spec/gen-rb/NonblockingService.rb
index 43273ec..5893f74 100644
--- a/lib/rb/spec/gen-rb/NonblockingService.rb
+++ b/lib/rb/spec/gen-rb/NonblockingService.rb
@@ -6,7 +6,7 @@
require 'thrift'
require 'thrift/protocol'
-require 'ThriftSpec_types'
+require File.dirname(__FILE__) + '/ThriftSpec_types'
module SpecNamespace
module NonblockingService
diff --git a/lib/rb/spec/gen-rb/ThriftSpec_constants.rb b/lib/rb/spec/gen-rb/ThriftSpec_constants.rb
index 2fc84fa..973501c 100644
--- a/lib/rb/spec/gen-rb/ThriftSpec_constants.rb
+++ b/lib/rb/spec/gen-rb/ThriftSpec_constants.rb
@@ -5,7 +5,7 @@
#
require 'thrift/protocol'
-require 'ThriftSpec_types'
+require File.dirname(__FILE__) + '/ThriftSpec_types'
module SpecNamespace
end
diff --git a/lib/rb/spec/nonblockingserver_spec.rb b/lib/rb/spec/nonblockingserver_spec.rb
index ae7fe2c..0eed1dd 100644
--- a/lib/rb/spec/nonblockingserver_spec.rb
+++ b/lib/rb/spec/nonblockingserver_spec.rb
@@ -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
diff --git a/lib/rb/spec/serializer_spec.rb b/lib/rb/spec/serializer_spec.rb
index 57e20ab..fe5a86a 100644
--- a/lib/rb/spec/serializer_spec.rb
+++ b/lib/rb/spec/serializer_spec.rb
@@ -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
diff --git a/lib/rb/spec/spec_helper.rb b/lib/rb/spec/spec_helper.rb
index 9498d2a..874ed2d 100644
--- a/lib/rb/spec/spec_helper.rb
+++ b/lib/rb/spec/spec_helper.rb
@@ -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
diff --git a/lib/rb/spec/struct_spec.rb b/lib/rb/spec/struct_spec.rb
index 6dd2868..eb0542b 100644
--- a/lib/rb/spec/struct_spec.rb
+++ b/lib/rb/spec/struct_spec.rb
@@ -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
diff --git a/lib/rb/spec/types_spec.rb b/lib/rb/spec/types_spec.rb
index 15ffe5c..4c2b4ea 100644
--- a/lib/rb/spec/types_spec.rb
+++ b/lib/rb/spec/types_spec.rb
@@ -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