fallback_on_error: fix Naming/PredicateMethod error

This commit is contained in:
Carlo Cabrera 2025-07-12 04:36:19 +08:00 committed by Carlo Cabrera
parent 00b668a214
commit 319542ef44
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -91,7 +91,7 @@ class Bottle
def fetch(verify_download_integrity: true, timeout: nil, quiet: false)
resource.fetch(verify_download_integrity:, timeout:, quiet:)
rescue DownloadError
raise unless fallback_on_error
raise unless fallback_on_error?
fetch_tab
retry
@ -121,7 +121,7 @@ class Bottle
begin
resource.fetch(timeout:, quiet:)
rescue DownloadError
raise unless fallback_on_error
raise unless fallback_on_error?
retry
rescue Resource::BottleManifest::Error
@ -193,7 +193,7 @@ class Bottle
specs
end
def fallback_on_error
def fallback_on_error?
# Use the default bottle domain as a fallback mirror
if @resource.url.start_with?(Homebrew::EnvConfig.bottle_domain) &&
Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN