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