diff options
Diffstat (limited to 'Library')
| -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 |
