Allow gem installation on Rubies other than 2.6
This commit is contained in:
parent
9b318a54d0
commit
796bad98ff
1
.gitignore
vendored
1
.gitignore
vendored
@ -31,6 +31,7 @@
|
||||
**/vendor/bundle/ruby/*/cache
|
||||
**/vendor/bundle/ruby/*/extensions
|
||||
**/vendor/bundle/ruby/*/gems/*/*
|
||||
**/vendor/bundle/ruby/*/plugins
|
||||
**/vendor/bundle/ruby/*/specifications
|
||||
|
||||
# Ignore YARD files
|
||||
|
@ -42,7 +42,6 @@ end
|
||||
gem "activesupport"
|
||||
gem "addressable"
|
||||
gem "concurrent-ruby"
|
||||
gem "did_you_mean" # remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
|
||||
gem "mechanize"
|
||||
gem "patchelf"
|
||||
gem "plist"
|
||||
@ -52,3 +51,8 @@ gem "rubocop-rspec"
|
||||
gem "rubocop-sorbet"
|
||||
gem "ruby-macho"
|
||||
gem "sorbet-runtime"
|
||||
|
||||
# remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
|
||||
install_if -> { RUBY_VERSION < "2.7" } do
|
||||
gem "did_you_mean"
|
||||
end
|
||||
|
@ -64,7 +64,7 @@ module Homebrew
|
||||
paths = ENV.fetch("PATH").split(":")
|
||||
paths.unshift(ruby_bindir) unless paths.include?(ruby_bindir)
|
||||
paths.unshift(Gem.bindir) unless paths.include?(Gem.bindir)
|
||||
paths.unshift(HOMEBREW_SHIMS_PATH/"ruby") unless paths.include?(HOMEBREW_SHIMS_PATH/"ruby")
|
||||
paths.unshift(HOMEBREW_LIBRARY_PATH/"shims/ruby") unless paths.include?(HOMEBREW_LIBRARY_PATH/"shims/ruby")
|
||||
ENV["PATH"] = paths.compact.join(":")
|
||||
|
||||
# Set envs so the above binaries can be invoked.
|
||||
@ -80,8 +80,9 @@ module Homebrew
|
||||
|
||||
if specs.empty?
|
||||
ohai_if_defined "Installing '#{name}' gem"
|
||||
# document: [] , is equivalent to --no-document
|
||||
specs = Gem.install name, version, document: []
|
||||
# `document: []` is equivalent to --no-document
|
||||
# `build_args: []` stops ARGV being used as a default
|
||||
specs = Gem.install name, version, document: [], build_args: []
|
||||
end
|
||||
|
||||
specs += specs.flat_map(&:runtime_dependencies)
|
||||
@ -115,10 +116,6 @@ module Homebrew
|
||||
end
|
||||
|
||||
def install_bundler!
|
||||
if Gem.ruby_version >= Gem::Version.new("2.7")
|
||||
raise "Installing and using Bundler is currently only supported on Ruby 2.6."
|
||||
end
|
||||
|
||||
setup_gem_environment!
|
||||
install_gem_setup_path!(
|
||||
"bundler",
|
||||
|
Loading…
x
Reference in New Issue
Block a user