Collapse begin..end into def..end and use else clause

This commit is contained in:
Jack Nagel 2014-02-18 15:08:03 -05:00
parent d63ef14794
commit c9784c1857

View File

@ -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