Collapse begin..end into def..end and use else clause
This commit is contained in:
parent
d63ef14794
commit
c9784c1857
@ -76,14 +76,13 @@ class Resource
|
|||||||
|
|
||||||
# For brew-fetch and others.
|
# For brew-fetch and others.
|
||||||
def fetch
|
def fetch
|
||||||
begin
|
# Ensure the cache exists
|
||||||
# Ensure the cache exists
|
HOMEBREW_CACHE.mkpath
|
||||||
HOMEBREW_CACHE.mkpath
|
downloader.fetch
|
||||||
downloader.fetch
|
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
||||||
cached_download
|
raise DownloadError.new(downloader.name)
|
||||||
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
else
|
||||||
raise DownloadError.new(downloader.name)
|
cached_download
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_download_integrity fn
|
def verify_download_integrity fn
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user