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.
This commit is contained in:
Hiroshi SHIBATA 2023-03-06 10:27:29 +09:00
parent 84150e6901
commit 38831ae290
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -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