ruby@2.3: update gem to 2.7.4
This commit is contained in:
parent
d7598b497b
commit
19a7cfafa5
1 changed files with 28 additions and 7 deletions
|
@ -3,7 +3,7 @@ class RubyAT23 < Formula
|
|||
homepage "https://www.ruby-lang.org/"
|
||||
url "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.xz"
|
||||
sha256 "e0d969ac22d4a403c1204868bb9c0d068aa35045bb3934cf50b17b7f66059f56"
|
||||
revision 1
|
||||
revision 2
|
||||
|
||||
bottle do
|
||||
sha256 "53f04a6214f07e60b08b5a7b75ba6fb81d15b4ffdfc0b042c14866709207231d" => :high_sierra
|
||||
|
@ -30,8 +30,8 @@ class RubyAT23 < Formula
|
|||
# but a revision bump should not be forced every update
|
||||
# unless there are security fixes in that Rubygems release.
|
||||
resource "rubygems" do
|
||||
url "https://rubygems.org/rubygems/rubygems-2.6.14.tgz"
|
||||
sha256 "406a45d258707f52241843e9c7902bbdcf00e7edc3e88cdb79c46659b47851ec"
|
||||
url "https://rubygems.org/rubygems/rubygems-2.7.4.tgz"
|
||||
sha256 "bbe35ce6646e4168fcb1071d5f83b2d1154924f5150df0f5fca0f37d2583a182"
|
||||
end
|
||||
|
||||
def program_suffix
|
||||
|
@ -46,6 +46,10 @@ class RubyAT23 < Formula
|
|||
"2.3.0"
|
||||
end
|
||||
|
||||
def rubygems_bindir
|
||||
HOMEBREW_PREFIX/"lib/ruby/gems/#{api_version}/bin"
|
||||
end
|
||||
|
||||
def install
|
||||
# otherwise `gem` command breaks
|
||||
ENV.delete("SDKROOT")
|
||||
|
@ -113,10 +117,24 @@ class RubyAT23 < Formula
|
|||
# Drop in the new version.
|
||||
rg_in.install Dir[buildpath/"vendor_gem/lib/*"]
|
||||
bin.install buildpath/"vendor_gem/bin/gem" => "gem#{program_suffix}"
|
||||
(libexec/"gembin").install buildpath/"vendor_gem/bin/bundle" => "bundle#{program_suffix}"
|
||||
(libexec/"gembin").install_symlink "bundle#{program_suffix}" => "bundler#{program_suffix}"
|
||||
end
|
||||
end
|
||||
|
||||
def post_install
|
||||
# Since Gem ships Bundle we want to provide that full/expected installation
|
||||
# but to do so we need to handle the case where someone has previously
|
||||
# installed bundle manually via `gem install`.
|
||||
rm_f %W[
|
||||
#{rubygems_bindir}/bundle
|
||||
#{rubygems_bindir}/bundle#{program_suffix}
|
||||
#{rubygems_bindir}/bundler
|
||||
#{rubygems_bindir}/bundler#{program_suffix}
|
||||
]
|
||||
rm_rf Dir[HOMEBREW_PREFIX/"lib/ruby/gems/#{api_version}/gems/bundler-*"]
|
||||
rubygems_bindir.install_symlink Dir[libexec/"gembin/*"]
|
||||
|
||||
# Customize rubygems to look/install in the global gem directory
|
||||
# instead of in the Cellar, making gems last across reinstalls
|
||||
config_file = lib/"ruby/#{api_version}/rubygems/defaults/operating_system.rb"
|
||||
|
@ -129,10 +147,6 @@ class RubyAT23 < Formula
|
|||
end
|
||||
end
|
||||
|
||||
def rubygems_bindir
|
||||
"#{HOMEBREW_PREFIX}/lib/ruby/gems/#{api_version}/bin"
|
||||
end
|
||||
|
||||
def rubygems_config; <<~EOS
|
||||
module Gem
|
||||
class << self
|
||||
|
@ -211,5 +225,12 @@ class RubyAT23 < Formula
|
|||
assert_equal "hello\n", hello_text
|
||||
ENV["GEM_HOME"] = testpath
|
||||
system "#{bin}/gem#{program_suffix}", "install", "json"
|
||||
|
||||
(testpath/"Gemfile").write <<~EOS
|
||||
source 'https://rubygems.org'
|
||||
gem 'gemoji'
|
||||
EOS
|
||||
system rubygems_bindir/"bundle#{program_suffix}", "install", "--binstubs=#{testpath}/bin"
|
||||
assert_predicate testpath/"bin/gemoji", :exist?, "gemoji is not installed in #{testpath}/bin"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue