mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Added initialization task for default gems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									2160c4dead
								
							
						
					
					
						commit
						a509de06bc
					
				
					 1 changed files with 31 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -76,12 +76,6 @@ $repositories = {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
  puts "Sync #{$repositories[gem.to_sym]}"
 | 
			
		||||
 | 
			
		||||
  case gem
 | 
			
		||||
| 
						 | 
				
			
			@ -218,8 +212,35 @@ def sync_lib(repo)
 | 
			
		|||
  `cp -f ../#{repo}/#{repo}.gemspec #{gemspec}`
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
if ARGV[0]
 | 
			
		||||
  sync_default_gems(ARGV[0])
 | 
			
		||||
else
 | 
			
		||||
  $repositories.keys.each{|gem| sync_default_gems(gem.to_s)}
 | 
			
		||||
def update_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
 | 
			
		||||
 | 
			
		||||
  Dir.chdir("../../#{author}/#{repository}") do
 | 
			
		||||
    unless `git remote`.match(/ruby\-core/)
 | 
			
		||||
      `git remote add ruby-core git@github.com:ruby/ruby.git`
 | 
			
		||||
      `git fetch ruby-core`
 | 
			
		||||
      `git co ruby-core/trunk`
 | 
			
		||||
      `git branch ruby-core`
 | 
			
		||||
    end
 | 
			
		||||
    `git co ruby-core`
 | 
			
		||||
    `git fetch ruby-core trunk`
 | 
			
		||||
    `git rebase ruby-core/trunk`
 | 
			
		||||
    `git co master`
 | 
			
		||||
    `git stash`
 | 
			
		||||
    `git pull --rebase`
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
case ARGV[0]
 | 
			
		||||
when "up"
 | 
			
		||||
  $repositories.keys.each{|gem| update_default_gems(gem.to_s)}
 | 
			
		||||
when "all"
 | 
			
		||||
  $repositories.keys.each{|gem| sync_default_gems(gem.to_s)}
 | 
			
		||||
else
 | 
			
		||||
  sync_default_gems(ARGV[0])
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue