diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-06 10:27:29 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-06 10:42:36 +0900 |
commit | 38831ae290ac421e48083ab8f134467eefc13676 (patch) | |
tree | bf5a71b76ac8264d78a5f20fc62dcb33080c3acf /tool/update-bundled_gems.rb | |
parent | 84150e6901ad0599d7bcbab34aed2f20235959ff (diff) | |
download | ruby-38831ae290ac421e48083ab8f134467eefc13676.tar.gz |
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.
Diffstat (limited to 'tool/update-bundled_gems.rb')
-rwxr-xr-x | tool/update-bundled_gems.rb | 8 |
1 files changed, 6 insertions, 2 deletions
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 |