diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2018-10-16 18:16:00 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2018-10-16 18:16:00 +0900 |
commit | 9c90f2cacded9bf11db7fc126531f517e6e24a52 (patch) | |
tree | 00592308f86e56cd93cc1bb596c66cebb9de2588 | |
parent | b5ca78bce5e1ca284d561bcdbbb337d3077b523f (diff) | |
download | ruby-bundler.tar.gz |
Picked latest patchesbundler
-rw-r--r-- | lib/bundler/shared_helpers.rb | 12 | ||||
-rw-r--r-- | spec/bundler/support/helpers.rb | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index fa7024534e..dee7b2300a 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -267,12 +267,10 @@ module Bundler until !File.directory?(current) || current == previous if ENV["BUNDLE_SPEC_RUN"] - if File.file?(File.join(current, "bundler.gemspec")) - gemspec = "bundler.gemspec" - else - # for Ruby Core - gemspec = "lib/bundler.gemspec" - end + 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 return nil if File.file?(File.join(current, gemspec)) end @@ -303,11 +301,11 @@ 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 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) - ensure Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file end diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index b7cb353c29..876494afbd 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -219,11 +219,7 @@ module Spec bang :gem_command def rake - if ENV['BUNDLE_RUBY'] && ENV['BUNDLE_GEM'] - "'#{ENV['BUNDLE_RUBY']}' -S '#{ENV['GEM_PATH']}/bin/rake'" - else - 'rake' - end + "#{Gem.ruby} -S #{ENV["GEM_PATH"]}/bin/rake" end def sys_exec(cmd) |