diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-07-31 00:04:16 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-08-05 09:44:18 +0900 |
commit | 44a0a66559ee4a03a84c27feca05e9b1b0f59df8 (patch) | |
tree | b2b574c9e44bfafdbe3561e50f68bffd4c8a5373 | |
parent | 41516b35418d6108c75d9f2190a846ded6a47108 (diff) |
Move to tool/lib/bundled_gem.rb
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6203
-rw-r--r-- | common.mk | 6 | ||||
-rw-r--r-- | defs/gmake.mk | 4 | ||||
-rw-r--r-- | tool/lib/bundled_gem.rb (renamed from tool/gem-unpack.rb) | 4 |
3 files changed, 8 insertions, 6 deletions
@@ -1361,16 +1361,16 @@ update-gems$(gnumake:yes=-sequential): PHONY extract-gems$(gnumake:yes=-sequential): PHONY $(ECHO) Extracting bundled gem files... $(Q) $(BASERUBY) -C "$(srcdir)" \ - -Itool -rfileutils -rgem-unpack -answ \ + -Itool/lib -rfileutils -rbundled_gem -answ \ -e 'BEGIN {d = ".bundle/gems"}' \ -e 'gem, ver, _, rev = *$$F' \ -e 'next if !ver or /^#/=~gem' \ -e 'g = "#{gem}-#{ver}"' \ -e 'if File.directory?("#{d}/#{g}")' \ -e 'elsif rev and File.exist?(gs = "gems/src/#{gem}/#{gem}.gemspec")' \ - -e 'Gem.copy(gs, ".bundle")' \ + -e 'BundledGem.copy(gs, ".bundle")' \ -e 'else' \ - -e 'Gem.unpack("gems/#{g}.gem", ".bundle")' \ + -e 'BundledGem.unpack("gems/#{g}.gem", ".bundle")' \ -e 'end' \ gems/bundled_gems diff --git a/defs/gmake.mk b/defs/gmake.mk index 9d7bf029e2..202858eda9 100644 --- a/defs/gmake.mk +++ b/defs/gmake.mk @@ -300,8 +300,8 @@ extract-gems: | $(patsubst %,.bundle/gems/%,$(bundled-gems)) .bundle/gems/%: gems/%.gem | .bundle/gems $(ECHO) Extracting bundle gem $*... $(Q) $(BASERUBY) -C "$(srcdir)" \ - -Itool -rgem-unpack \ - -e 'Gem.unpack("gems/$(@F).gem", ".bundle")' + -Itool/lib -rbundled_gem \ + -e 'BundledGem.unpack("gems/$(@F).gem", ".bundle")' $(srcdir)/.bundle/gems: $(MAKEDIRS) $@ diff --git a/tool/gem-unpack.rb b/tool/lib/bundled_gem.rb index 6310c3f92a..0b7d52b86a 100644 --- a/tool/gem-unpack.rb +++ b/tool/lib/bundled_gem.rb @@ -5,7 +5,9 @@ require 'rubygems/package' # This library is used by "make extract-gems" to # unpack bundled gem files. -class << Gem +module BundledGem + module_function + def unpack(file, *rest) pkg = Gem::Package.new(file) prepare_test(pkg.spec, *rest) {|dir| pkg.extract_files(dir)} |