GithubLatest: Use API URL as generated value
The generated URL should reflect what we're actually checking, which is now the `/releases/latest` API URL.
This commit is contained in:
parent
34e2779150
commit
cfba45fb56
@ -76,8 +76,7 @@ module Homebrew
|
|||||||
match = url.sub(/\.git$/i, "").match(URL_MATCH_REGEX)
|
match = url.sub(/\.git$/i, "").match(URL_MATCH_REGEX)
|
||||||
return values if match.blank?
|
return values if match.blank?
|
||||||
|
|
||||||
# Example URL: `https://github.com/example/example/releases/latest`
|
values[:url] = "https://api.github.com/repos/#{match[:username]}/#{match[:repository]}/releases/latest"
|
||||||
values[:url] = "https://github.com/#{match[:username]}/#{match[:repository]}/releases/latest"
|
|
||||||
values[:username] = match[:username]
|
values[:username] = match[:username]
|
||||||
values[:repository] = match[:repository]
|
values[:repository] = match[:repository]
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ describe Homebrew::Livecheck::Strategy::GithubLatest do
|
|||||||
|
|
||||||
let(:generated) do
|
let(:generated) do
|
||||||
{
|
{
|
||||||
|
url: "https://api.github.com/repos/abc/def/releases/latest",
|
||||||
username: "abc",
|
username: "abc",
|
||||||
url: "https://github.com/abc/def/releases/latest",
|
|
||||||
repository: "def",
|
repository: "def",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user