diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/shared_helpers.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index f0f576f931..50214901c5 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -274,7 +274,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| @@ -303,10 +311,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 |