summaryrefslogtreecommitdiff
path: root/lib/bundler/shared_helpers.rb
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2018-10-16 20:45:45 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2018-10-20 20:00:39 +0900
commit5417b218c499db48b23de2bdc38ba2f33d3223c0 (patch)
tree8556a1c1d8e5811f86d2e63b931c1212ae40413a /lib/bundler/shared_helpers.rb
parentce655f16ca1cc4b07af4bb981c20636bc6b02c84 (diff)
downloadbundler-5417b218c499db48b23de2bdc38ba2f33d3223c0.tar.gz
Added to support BUNDLE_RUBY and BUNDLE_GEM environmental variables.
They are replaced build binary on ruby core repository.
Diffstat (limited to 'lib/bundler/shared_helpers.rb')
-rw-r--r--lib/bundler/shared_helpers.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 28699dc61f..9d5684aeaf 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -274,9 +274,13 @@ module Bundler
until !File.directory?(current) || current == previous
if ENV["BUNDLE_SPEC_RUN"]
- gemspec = File.join(current, "bundler.gemspec")
- # for Ruby Core
- gemspec = File.join(current, "lib/bundler.gemspec") unless File.file?(gemspec)
+ # avoid stepping above the tmp directory when testing
+ if !!(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
+ # for Ruby Core
+ gemspec = "lib/bundler.gemspec"
+ else
+ gemspec = "bundler.gemspec"
+ end
# avoid stepping above the tmp directory when testing
return nil if File.file?(File.join(current, gemspec))