aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 23:35:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 23:35:46 +0000
commitdd46eaa5780c8b5f5484869ea8dd3109e24b0f24 (patch)
treebae1fb44e423daa1c9e8b7a84989b36baf7218e9 /tool
parent7216e778978bcb9a50170bb8ba1748319d0e85f6 (diff)
downloadruby-dd46eaa5780c8b5f5484869ea8dd3109e24b0f24.tar.gz
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
Diffstat (limited to 'tool')
-rwxr-xr-x[-rw-r--r--]tool/fetch-bundled_gems.rb34
1 files changed, 22 insertions, 12 deletions
diff --git a/tool/fetch-bundled_gems.rb b/tool/fetch-bundled_gems.rb
index a0d7181b68..ae3068d35c 100644..100755
--- a/tool/fetch-bundled_gems.rb
+++ b/tool/fetch-bundled_gems.rb
@@ -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
+end
- 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}`
+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