From c9784c1857bd2d5942861199e77c0054a1013022 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 18 Feb 2014 15:08:03 -0500 Subject: [PATCH] Collapse begin..end into def..end and use else clause --- Library/Homebrew/resource.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index e0daf4a489..8c9e61ad85 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