diff options
| author | Jack Nagel | 2014-02-18 15:08:03 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-02-18 15:08:03 -0500 |
| commit | 011e49afb559156ec390edbcd398180aa6d1f708 (patch) | |
| tree | c669b98058fe1a70e8cf234f6820766fb66a4bdf /Library | |
| parent | c9bccb21873fe765dff681b005a330553cded898 (diff) | |
| download | homebrew-011e49afb559156ec390edbcd398180aa6d1f708.tar.bz2 | |
Collapse begin..end into def..end and use else clause
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/resource.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index e0daf4a48..8c9e61ad8 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -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 |
