Only check @specs for :using if @specs exists. Fixes Homebrew/homebrew#1127.

This commit is contained in:
Adam Vandenberg 2010-04-06 13:13:50 -07:00
parent 663ea030fc
commit d9fe4f00a4

View File

@ -134,21 +134,23 @@ class Formula
# reimplement if we don't autodetect the download strategy you require # reimplement if we don't autodetect the download strategy you require
def download_strategy def download_strategy
vcs = @specs.delete :using if @specs
if vcs != nil vcs = @specs.delete :using
# If a class is passed, assume it is a download strategy if vcs != nil
return vcs if vcs.kind_of? Class # If a class is passed, assume it is a download strategy
return vcs if vcs.kind_of? Class
case vcs case vcs
when :bzr then return BazaarDownloadStrategy when :bzr then return BazaarDownloadStrategy
when :curl then return CurlDownloadStrategy when :curl then return CurlDownloadStrategy
when :cvs then return CVSDownloadStrategy when :cvs then return CVSDownloadStrategy
when :git then return GitDownloadStrategy when :git then return GitDownloadStrategy
when :hg then return MercurialDownloadStrategy when :hg then return MercurialDownloadStrategy
when :svn then return SubversionDownloadStrategy when :svn then return SubversionDownloadStrategy
end
raise "Unknown strategy #{vcs} was requested."
end end
raise "Unknown strategy #{vcs} was requested."
end end
detect_download_strategy url detect_download_strategy url