aboutsummaryrefslogtreecommitdiffstats
path: root/tool/update-bundled_gems.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-21 20:44:13 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-21 20:44:13 +0900
commitc25cf1eaaa886aaf510ebe92961daab716a6faef (patch)
tree317e317e064348b6d4dfbb5df60cea4cc77d8533 /tool/update-bundled_gems.rb
parent04b5e85bfda5ba281f2129d148c952eabc5e49a3 (diff)
downloadruby-c25cf1eaaa886aaf510ebe92961daab716a6faef.tar.gz
Drop optional commit hash when updated
Diffstat (limited to 'tool/update-bundled_gems.rb')
-rwxr-xr-x[-rw-r--r--]tool/update-bundled_gems.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/tool/update-bundled_gems.rb b/tool/update-bundled_gems.rb
index cef31e2f13..48dcaa9f2c 100644..100755
--- a/tool/update-bundled_gems.rb
+++ b/tool/update-bundled_gems.rb
@@ -9,6 +9,12 @@ unless /^[^#]/ !~ (gem = $F[0])
gem = src.fetch_spec(gem)
uri = gem.metadata["source_code_uri"] || gem.homepage
uri = uri.sub(%r[\Ahttps://github\.com/[^/]+/[^/]+\K/tree/.*], "").chomp(".git")
- $F[3][$F[1]] = gem.version.to_s if $F[3] && $F[3].include?($F[1])
+ if $F[3]
+ if $F[3].include?($F[1])
+ $F[3][$F[1]] = gem.version.to_s
+ elsif $F[2] != gem.version and /\A\h+\z/ =~ $F[3]
+ $F[3..-1] = []
+ end
+ end
$_ = [gem.name, gem.version, uri, *$F[3..-1]].join(" ")
end