From d04963501bc057685220fa1160fb9a102dd46d57 Mon Sep 17 00:00:00 2001 From: hsbt Date: Mon, 18 Feb 2019 13:33:25 +0000 Subject: Use ENV["BUNDLE_GEM"] instead of gem command provided by system ruby. It break the examples of bundler. Because some examples detect the different version of system ruby than test target version like trunk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/bundler/gem_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/bundler') diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index e7673cba88..55f484f723 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -74,7 +74,8 @@ module Bundler def build_gem file_name = nil - sh("gem build -V '#{spec_path}'") do + gem = ENV["BUNDLE_GEM"] ? ENV["BUNDLE_GEM"] : "gem" + sh("#{gem} build -V '#{spec_path}'") do file_name = File.basename(built_gem_path) SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) } FileUtils.mv(built_gem_path, "pkg") @@ -85,7 +86,8 @@ module Bundler def install_gem(built_gem_path = nil, local = false) built_gem_path ||= build_gem - out, _ = sh_with_code("gem install '#{built_gem_path}'#{" --local" if local}") + gem = ENV["BUNDLE_GEM"] ? ENV["BUNDLE_GEM"] : "gem" + out, _ = sh_with_code("#{gem} install '#{built_gem_path}'#{" --local" if local}") raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output" unless out[/Successfully installed/] Bundler.ui.confirm "#{name} (#{version}) installed." end -- cgit v1.2.3