GithubLatest: Include URL in match_data
It's standard for the `match_data` to include the URL (e.g., as in `PageMatch`). This uses the provided URL by default, switching to the generated URL when available.
This commit is contained in:
parent
cfba45fb56
commit
303ac147a9
@ -134,10 +134,13 @@ module Homebrew
|
||||
).returns(T::Hash[Symbol, T.untyped])
|
||||
}
|
||||
def self.find_versions(url:, regex: DEFAULT_REGEX, **_unused, &block)
|
||||
match_data = { matches: {}, regex: regex }
|
||||
match_data = { matches: {}, regex: regex, url: url }
|
||||
|
||||
generated = generate_input_values(url)
|
||||
return match_data if generated.blank?
|
||||
|
||||
match_data[:url] = generated[:url]
|
||||
|
||||
release = GitHub.get_latest_release(generated[:username], generated[:repository])
|
||||
versions_from_content([release], regex, &block).each do |match_text|
|
||||
match_data[:matches][match_text] = Version.new(match_text)
|
||||
|
Loading…
x
Reference in New Issue
Block a user