summaryrefslogtreecommitdiff
path: root/lib/bundler/shared_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/shared_helpers.rb')
-rw-r--r--lib/bundler/shared_helpers.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index dca17885dd..e09e5e8b74 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -275,7 +275,15 @@ module Bundler
until !File.directory?(current) || current == previous
if ENV["BUNDLE_SPEC_RUN"]
# avoid stepping above the tmp directory when testing
- return nil if File.file?(File.join(current, "bundler.gemspec"))
+ gemspec = if ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]
+ # for Ruby Core
+ "lib/bundler.gemspec"
+ else
+ "bundler.gemspec"
+ end
+
+ # avoid stepping above the tmp directory when testing
+ return nil if File.file?(File.join(current, gemspec))
end
names.each do |name|
@@ -304,10 +312,12 @@ module Bundler
unless File.exist?(exe_file)
exe_file = File.expand_path("../../../exe/bundle", __FILE__)
end
-
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
rescue Gem::GemNotFoundException
- Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", File.expand_path("../../../exe/bundle", __FILE__)
+ exe_file = File.expand_path("../../../exe/bundle", __FILE__)
+ # for Ruby core repository
+ exe_file = File.expand_path("../../../../bin/bundle", __FILE__) unless File.exist?(exe_file)
+ Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
end
# Set BUNDLE_GEMFILE