diff options
| author | Jack Nagel | 2014-02-18 15:08:03 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-02-18 15:08:03 -0500 |
| commit | c9784c1857bd2d5942861199e77c0054a1013022 (patch) | |
| tree | 5561d2a9bf6a278727545a54d7eda0f85e84aacd /Library | |
| parent | d63ef14794c60464108be85cb5eeedb829261cab (diff) | |
| download | brew-c9784c1857bd2d5942861199e77c0054a1013022.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 |
