diff options
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 1bb4889d1..2bba3d4e7 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -134,6 +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 + + raise "Unknown strategy #{vcs} was requested." + end + detect_download_strategy url end |
