mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
fallback_on_error: fix Naming/PredicateMethod error
This commit is contained in:
parent
00b668a214
commit
319542ef44
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user