Merge pull request #6660 from MikeMcQuaid/bundler-from-ruby
Use bundler from Ruby 2.6
This commit is contained in:
commit
d044c46beb
@ -132,4 +132,4 @@ DEPENDENCIES
|
|||||||
simplecov
|
simplecov
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.2
|
1.17.2
|
||||||
|
@ -69,9 +69,7 @@ module Homebrew
|
|||||||
|
|
||||||
def install_gem_setup_path!(name, version: nil, executable: name, setup_gem_environment: true)
|
def install_gem_setup_path!(name, version: nil, executable: name, setup_gem_environment: true)
|
||||||
install_gem!(name, version: version, setup_gem_environment: setup_gem_environment)
|
install_gem!(name, version: version, setup_gem_environment: setup_gem_environment)
|
||||||
return if ENV["PATH"].split(":").any? do |path|
|
return if find_in_path(executable)
|
||||||
File.executable?("#{path}/#{executable}")
|
|
||||||
end
|
|
||||||
|
|
||||||
odie_if_defined <<~EOS
|
odie_if_defined <<~EOS
|
||||||
the '#{name}' gem is installed but couldn't find '#{executable}' in the PATH:
|
the '#{name}' gem is installed but couldn't find '#{executable}' in the PATH:
|
||||||
@ -79,10 +77,16 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_in_path(executable)
|
||||||
|
ENV["PATH"].split(":").find do |path|
|
||||||
|
File.executable?("#{path}/#{executable}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def install_bundler!
|
def install_bundler!
|
||||||
require "rubygems"
|
require "rubygems"
|
||||||
setup_gem_environment!(gem_home: Gem.user_dir, gem_bindir: gem_user_bindir)
|
setup_gem_environment!(gem_home: Gem.user_dir, gem_bindir: gem_user_bindir)
|
||||||
install_gem_setup_path!("bundler", version: ">=2", executable: "bundle", setup_gem_environment: false)
|
install_gem_setup_path!("bundler", version: ">=1.17", executable: "bundle", setup_gem_environment: false)
|
||||||
end
|
end
|
||||||
|
|
||||||
def install_bundler_gems!
|
def install_bundler_gems!
|
||||||
@ -90,7 +94,7 @@ module Homebrew
|
|||||||
|
|
||||||
ENV["BUNDLE_GEMFILE"] = "#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/Gemfile"
|
ENV["BUNDLE_GEMFILE"] = "#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/Gemfile"
|
||||||
@bundle_installed ||= begin
|
@bundle_installed ||= begin
|
||||||
bundle = "#{gem_user_bindir}/bundle"
|
bundle = "#{find_in_path(bundle)}/bundle"
|
||||||
bundle_check_output = `#{bundle} check 2>&1`
|
bundle_check_output = `#{bundle} check 2>&1`
|
||||||
bundle_check_failed = !$CHILD_STATUS.success?
|
bundle_check_failed = !$CHILD_STATUS.success?
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
2.6.1
|
|
@ -260,4 +260,4 @@ DEPENDENCIES
|
|||||||
rake
|
rake
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.1
|
1.17.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user