From 0a2e9661b698662c5c64b2cfd269f7747be4c27d Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:13:36 -0400 Subject: [PATCH] Strategy#from_url: remove unused param The `url_provided` parameter of the `Strategy#from_url` method was originally introduced in #9529 but I removed it in a later commit in that PR in favor of a different approach. Unfortunately, I forgot to remove the `url_provided` parameter, as it was no longer needed after that change. This removes the parameter and updates `#from_url` calls accordingly. --- Library/Homebrew/livecheck/livecheck.rb | 2 -- Library/Homebrew/livecheck/strategy.rb | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index 2948cd871f..c5739a6cb1 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -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?, ) diff --git a/Library/Homebrew/livecheck/strategy.rb b/Library/Homebrew/livecheck/strategy.rb index f599807746..be885df754 100644 --- a/Library/Homebrew/livecheck/strategy.rb +++ b/Library/Homebrew/livecheck/strategy.rb @@ -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