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.
|
||||
def fetch
|
||||
begin
|
||||
# Ensure the cache exists
|
||||
HOMEBREW_CACHE.mkpath
|
||||
downloader.fetch
|
||||
cached_download
|
||||
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
||||
raise DownloadError.new(downloader.name)
|
||||
end
|
||||
# Ensure the cache exists
|
||||
HOMEBREW_CACHE.mkpath
|
||||
downloader.fetch
|
||||
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
||||
raise DownloadError.new(downloader.name)
|
||||
else
|
||||
cached_download
|
||||
end
|
||||
|
||||
def verify_download_integrity fn
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user