From 38831ae290ac421e48083ab8f134467eefc13676 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 6 Mar 2023 10:27:29 +0900 Subject: Introduce `UPDATE_BUNDLED_GEMS_ALL` option for auto update for bundled_gems file We used `url` field for testing via git clone. Because `Gem::Specification#homepage` or `Gem::Specification#metadata` could assign non-git url. Unfotunately, We should specify clone URL for testing. --- tool/update-bundled_gems.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tool/update-bundled_gems.rb') diff --git a/tool/update-bundled_gems.rb b/tool/update-bundled_gems.rb index c8927b878d..688ca34086 100755 --- a/tool/update-bundled_gems.rb +++ b/tool/update-bundled_gems.rb @@ -7,8 +7,12 @@ unless /^[^#]/ !~ (gem = $F[0]) s.platform == "ruby" && s.name == gem } gem = src.fetch_spec(gem) - uri = gem.metadata["source_code_uri"] || gem.homepage - uri = uri.sub(%r[\Ahttps://github\.com/[^/]+/[^/]+\K/tree/.*], "").chomp(".git") + if ENV["UPDATE_BUNDLED_GEMS_ALL"] + uri = gem.metadata["source_code_uri"] || gem.homepage + uri = uri.sub(%r[\Ahttps://github\.com/[^/]+/[^/]+\K/tree/.*], "").chomp(".git") + else + uri = $F[2] + end if $F[3] if $F[3].include?($F[1]) $F[3][$F[1]] = gem.version.to_s -- cgit v1.2.1