Merge pull request #17863 from samford/livecheck/remove-unused-from_url-param

This commit is contained in:
Mike McQuaid 2024-07-25 19:51:58 +01:00 committed by GitHub
commit bdee21b706
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 6 deletions

View File

@ -715,7 +715,6 @@ module Homebrew
strategies = Strategy.from_url(
url,
livecheck_strategy:,
url_provided: livecheck_url.present?,
regex_provided: livecheck_regex.present?,
block_provided: livecheck_strategy_block.present?,
)
@ -930,7 +929,6 @@ module Homebrew
strategies = Strategy.from_url(
url,
livecheck_strategy:,
url_provided: livecheck_url.present?,
regex_provided: livecheck_regex.present?,
block_provided: livecheck_strategy_block.present?,
)

View File

@ -125,8 +125,6 @@ module Homebrew
# @param url [String] the URL to check for matching strategies
# @param livecheck_strategy [Symbol] a strategy symbol from the
# `livecheck` block
# @param url_provided [Boolean] whether a url is provided in the
# `livecheck` block
# @param regex_provided [Boolean] whether a regex is provided in the
# `livecheck` block
# @param block_provided [Boolean] whether a `strategy` block is provided
@ -136,12 +134,11 @@ module Homebrew
params(
url: String,
livecheck_strategy: T.nilable(Symbol),
url_provided: T::Boolean,
regex_provided: T::Boolean,
block_provided: T::Boolean,
).returns(T::Array[T.untyped])
}
def from_url(url, livecheck_strategy: nil, url_provided: false, regex_provided: false, block_provided: false)
def from_url(url, livecheck_strategy: nil, regex_provided: false, block_provided: false)
usable_strategies = strategies.select do |strategy_symbol, strategy|
if strategy == PageMatch
# Only treat the strategy as usable if the `livecheck` block