aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-04-06 13:13:50 -0700
committerAdam Vandenberg2010-04-06 13:13:50 -0700
commitd9fe4f00a419fd7095627b3f9996736048e73041 (patch)
treeaf26c448ddc68818bc52869778e98eb6bf7161d8 /Library
parent663ea030fc8a93ae66e6fbf148d7af88eec7c6cf (diff)
downloadbrew-d9fe4f00a419fd7095627b3f9996736048e73041.tar.bz2
Only check @specs for :using if @specs exists. Fixes Homebrew/homebrew#1127.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb30
1 files changed, 16 insertions, 14 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 2bba3d4e7..66219e726 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -134,21 +134,23 @@ class Formula
# reimplement if we don't autodetect the download strategy you require
def download_strategy
- vcs = @specs.delete :using
- if vcs != nil
- # If a class is passed, assume it is a download strategy
- return vcs if vcs.kind_of? Class
-
- case vcs
- when :bzr then return BazaarDownloadStrategy
- when :curl then return CurlDownloadStrategy
- when :cvs then return CVSDownloadStrategy
- when :git then return GitDownloadStrategy
- when :hg then return MercurialDownloadStrategy
- when :svn then return SubversionDownloadStrategy
- end
+ if @specs
+ vcs = @specs.delete :using
+ if vcs != nil
+ # If a class is passed, assume it is a download strategy
+ return vcs if vcs.kind_of? Class
+
+ case vcs
+ when :bzr then return BazaarDownloadStrategy
+ when :curl then return CurlDownloadStrategy
+ when :cvs then return CVSDownloadStrategy
+ when :git then return GitDownloadStrategy
+ when :hg then return MercurialDownloadStrategy
+ when :svn then return SubversionDownloadStrategy
+ end
- raise "Unknown strategy #{vcs} was requested."
+ raise "Unknown strategy #{vcs} was requested."
+ end
end
detect_download_strategy url