diff options
| author | Adam Vandenberg | 2010-04-06 13:13:50 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-04-06 13:13:50 -0700 |
| commit | d9fe4f00a419fd7095627b3f9996736048e73041 (patch) | |
| tree | af26c448ddc68818bc52869778e98eb6bf7161d8 /Library/Homebrew | |
| parent | 663ea030fc8a93ae66e6fbf148d7af88eec7c6cf (diff) | |
| download | brew-d9fe4f00a419fd7095627b3f9996736048e73041.tar.bz2 | |
Only check @specs for :using if @specs exists. Fixes Homebrew/homebrew#1127.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula.rb | 30 |
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 |
