Added sync to all of default gems command.
* Fix command of FileUtils sync operation. test/fileutils is a directory. * When not given gem name option, do sync all of gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0ff27c4604
commit
4680341cac
@ -22,7 +22,7 @@
|
||||
# * https://github.com/ruby/strscan
|
||||
#
|
||||
|
||||
repositories = {
|
||||
$repositories = {
|
||||
rubygems: 'rubygems/rubygems',
|
||||
rdoc: 'rdoc/rdoc',
|
||||
json: 'flori/json',
|
||||
@ -44,13 +44,16 @@ repositories = {
|
||||
strscan: 'ruby/strscan',
|
||||
}
|
||||
|
||||
author, repository = repositories[ARGV[0].to_sym].split('/')
|
||||
def sync_default_gems(gem)
|
||||
author, repository = $repositories[gem.to_sym].split('/')
|
||||
unless File.exist?("../../#{author}/#{repository}")
|
||||
`mkdir -p ../../#{author}`
|
||||
`git clone git@github.com:#{author}/#{repository}.git ../../#{author}/#{repository}`
|
||||
end
|
||||
|
||||
case ARGV[0]
|
||||
puts "Sync #{$repositories[gem.to_sym]}"
|
||||
|
||||
case gem
|
||||
when "rubygems"
|
||||
`rm -rf lib/rubygems* lib/ubygems.rb test/rubygems`
|
||||
`cp -r ../../rubygems/rubygems/lib/rubygems* ./lib`
|
||||
@ -80,7 +83,7 @@ when "psych"
|
||||
`rm -rf ext/psych/lib/psych.bundle ext/psych/lib/org ext/psych/lib/psych.jar ext/psych/lib/psych_jars.rb`
|
||||
`cp ../psych/psych.gemspec ext/psych/`
|
||||
when "fileutils"
|
||||
`rm -f lib/fileutils.rb test/fileutils lib/fileutils.gemspec`
|
||||
`rm -rf lib/fileutils.rb test/fileutils lib/fileutils.gemspec`
|
||||
`cp -rf ../fileutils/lib/* lib`
|
||||
`cp -rf ../fileutils/test/fileutils test`
|
||||
`cp -f ../fileutils/fileutils.gemspec lib`
|
||||
@ -176,3 +179,10 @@ when "strscan"
|
||||
`git checkout ext/strscan/depend`
|
||||
else
|
||||
end
|
||||
end
|
||||
|
||||
if ARGV[0]
|
||||
sync_default_gems(ARGV[0])
|
||||
else
|
||||
$repositories.keys.each{|gem| sync_default_gems(gem.to_s)}
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user