aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMSP-Greg <MSP-Greg@users.noreply.github.com>2019-07-13 08:20:12 -0500
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:58 +0900
commit432285c0040d547c24294611725edddb78560ac2 (patch)
tree9c2537c44d89c620b4d0c9ea39dd7f897f89b18b /lib
parent24062bd323ec9c5311bbf2c5f8f2822f15a38c62 (diff)
downloadruby-432285c0040d547c24294611725edddb78560ac2.tar.gz
[bundler/bundler] fix nested bundle exec's when bundler is a default gem
https://github.com/bundler/bundler/commit/537c0ab712
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/shared_helpers.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index c5fa659a7b..85b92cf010 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -286,9 +286,15 @@ module Bundler
public :set_env
def set_bundle_variables
+ # bundler exe & lib folders have same root folder, typical gem installation
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)
+
+ # for Ruby core repository testing
+ exe_file = File.expand_path("../../../bin/bundle", __FILE__) unless File.exist?(exe_file)
+
+ # bundler is a default gem, exe path is separate
+ exe_file = Bundler.rubygems.bin_path("bundler", "bundle", VERSION) unless File.exist?(exe_file)
+
Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", find_gemfile.to_s
Bundler::SharedHelpers.set_env "BUNDLER_VERSION", Bundler::VERSION