mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test-bundled-gems-fetch
* tool/fetch-bundled_gems.rb: get rid of tool/git-refresh which requries Bourne shell. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b1dc607184
commit
ef82d94873
2 changed files with 27 additions and 15 deletions
|
@ -476,8 +476,10 @@ enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
|
|||
|
||||
test-bundled-gems-precheck: $(arch)-fake.rb programs
|
||||
|
||||
yes-test-bundled-gems-prepare: test-bundled-gems-precheck
|
||||
$(Q) $(BASERUBY) $(srcdir)/tool/fetch-bundled_gems.rb $(srcdir)
|
||||
test-bundled-gems-fetch: $(PREP)
|
||||
$(Q) $(BASERUBY) -C $(srcdir)/gems ../tool/fetch-bundled_gems.rb src bundled_gems
|
||||
|
||||
yes-test-bundled-gems-prepare: test-bundled-gems-precheck test-bundled-gems-fetch
|
||||
$(XRUBY) -C "$(srcdir)" bin/gem install --no-ri --no-rdoc \
|
||||
--install-dir .bundle --conservative 'minitest:~> 5' 'test-unit' 'rake' 'hoe' 'yard' 'pry' 'packnga'
|
||||
|
||||
|
|
36
tool/fetch-bundled_gems.rb
Normal file → Executable file
36
tool/fetch-bundled_gems.rb
Normal file → Executable file
|
@ -1,17 +1,27 @@
|
|||
require 'fileutils'
|
||||
#!ruby -an
|
||||
BEGIN {
|
||||
require 'fileutils'
|
||||
|
||||
File.readlines("#{ARGV[0]}/gems/bundled_gems").each do |gem|
|
||||
n, v, u = gem.split
|
||||
dir = ARGV.shift
|
||||
ARGF.eof?
|
||||
FileUtils.mkdir_p(dir)
|
||||
Dir.chdir(dir)
|
||||
}
|
||||
|
||||
n, v, u = $F
|
||||
case n
|
||||
when "minitest"
|
||||
v = "master"
|
||||
when "test-unit"
|
||||
else
|
||||
v = "v" + v
|
||||
|
||||
case n
|
||||
when "minitest"
|
||||
v = "master"
|
||||
when "test-unit"
|
||||
v = v[1..-1]
|
||||
end
|
||||
|
||||
FileUtils.mkdir_p "#{ARGV[0]}/gems/src"
|
||||
`#{ARGV[0]}/tool/git-refresh -C #{ARGV[0]}/gems/src --branch #{v} #{u} #{n}`
|
||||
end
|
||||
|
||||
if File.directory?(n)
|
||||
puts "updating #{n} ..."
|
||||
system(*%W"git fetch", chdir: n) or abort
|
||||
else
|
||||
puts "retrieving #{n} ..."
|
||||
system(*%W"git clone #{u} #{n}") or abort
|
||||
end
|
||||
system(*%W"git checkout #{v}", chdir: n) or abort
|
||||
|
|
Loading…
Add table
Reference in a new issue