ruby-changes:71346
From: Hiroshi <ko1@a...>
Date: Tue, 8 Mar 2022 21:09:08 +0900 (JST)
Subject: [ruby-changes:71346] 1adc7aa630 (master): Added release option to sync only released version of the default gems
https://git.ruby-lang.org/ruby.git/commit/?id=1adc7aa630 From 1adc7aa630d43e04cf5e75bbbbcf48b72a6e6c45 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Tue, 8 Mar 2022 21:08:46 +0900 Subject: Added release option to sync only released version of the default gems --- tool/sync_default_gems.rb | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index ca5283d2c3..fe7510c1aa 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -530,7 +530,7 @@ def sync_lib(repo, upstream = nil) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L530 cp_r("#{upstream}/#{repo}.gemspec", "#{gemspec}") end -def update_default_gems(gem) +def update_default_gems(gem, release: false) author, repository = REPOSITORIES[gem.to_sym].split('/') @@ -552,9 +552,15 @@ def update_default_gems(gem) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L552 end `git checkout ruby-core` `git rebase ruby-core/master` - `git checkout master` - `git fetch origin master` - `git rebase origin/master` + `git fetch origin --tags` + + if release + last_release = `git tag`.chomp.split.last + `git checkout #{last_release}` + else + `git checkout master` + `git rebase origin/master` + end end end @@ -566,7 +572,14 @@ when "up" https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L572 REPOSITORIES.keys.each{|gem| update_default_gems(gem.to_s)} end when "all" - REPOSITORIES.keys.each{|gem| sync_default_gems(gem.to_s)} + if ARGV[1] == "release" + REPOSITORIES.keys.each do |gem| + update_default_gems(gem.to_s, release: true) + sync_default_gems(gem.to_s) + end + else + REPOSITORIES.keys.each{|gem| sync_default_gems(gem.to_s)} + end when "list" ARGV.shift pattern = Regexp.new(ARGV.join('|')) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/