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. # 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