aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-05-16 14:06:26 -0500
committerJack Nagel2013-05-16 14:06:26 -0500
commit5b529b0851ccfd2a71c4bab28bf4732c20c6e428 (patch)
treea2450e109abf8bd1476a6cb5a9d2e1081140b664
parent75e371684eee49c699bcd192ecc98048855836ca (diff)
downloadhomebrew-5b529b0851ccfd2a71c4bab28bf4732c20c6e428.tar.bz2
Formula#fetch: always return the cached path
This allows us to remove some type checks that were protecting against potential nils.
-rw-r--r--Library/Homebrew/cmd/fetch.rb3
-rw-r--r--Library/Homebrew/formula.rb3
2 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb
index 24b1b0614..f075bcdce 100644
--- a/Library/Homebrew/cmd/fetch.rb
+++ b/Library/Homebrew/cmd/fetch.rb
@@ -27,8 +27,7 @@ module Homebrew extend self
f.cached_download.rmtree if already_fetched?(f) && ARGV.force?
download = f.fetch
- # FIXME why are strategies returning different types?
- return unless download.is_a? Pathname
+ return unless download.file?
puts "Downloaded to: #{download}" unless already_fetched?(f)
puts Checksum::TYPES.map { |t| "#{t.to_s.upcase}: #{download.send(t)}" }
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 53aec6dcf..21df196df 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -619,6 +619,7 @@ class Formula
# Ensure the cache exists
HOMEBREW_CACHE.mkpath
downloader.fetch
+ cached_download
end
# For FormulaInstaller.
@@ -644,7 +645,7 @@ class Formula
def stage
fetched = fetch
- verify_download_integrity(fetched) if fetched.kind_of? Pathname
+ verify_download_integrity(fetched) if fetched.file?
mktemp do
downloader.stage
# Set path after the downloader changes the working folder.