mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Move to tool/lib/bundled_gem.rb
This commit is contained in:
parent
41516b3541
commit
44a0a66559
Notes:
git
2022-08-05 13:00:56 +09:00
3 changed files with 8 additions and 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
|
||||
|
||||
|
|
|
@ -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) $@
|
||||
|
|
|
@ -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)}
|
Loading…
Add table
Reference in a new issue