1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/fetch-bundled_gems.rb
Nobuyoshi Nakada 26ee0af4b3
Test the bundled version minitest instead of master
Minitest has the released tags now.
2019-12-31 17:49:26 +09:00

29 lines
483 B
Ruby
Executable file

#!ruby -an
BEGIN {
require 'fileutils'
dir = ARGV.shift
ARGF.eof?
FileUtils.mkdir_p(dir)
Dir.chdir(dir)
}
n, v, u = $F
case n
when "test-unit"
else
v = "v" + v
end
if File.directory?(n)
puts "updating #{n} ..."
if v == "master"
system(*%W"git pull", chdir: n) or abort
else
system(*%W"git fetch", chdir: n) or abort
end
else
puts "retrieving #{n} ..."
system(*%W"git clone #{u} #{n}") or abort
end
system(*%W"git checkout #{v}", chdir: n) or abort