aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/download_strategy.rb
diff options
context:
space:
mode:
authorJack Nagel2014-03-18 15:28:21 -0500
committerJack Nagel2014-03-18 21:28:29 -0500
commitbacc2b5e8f58238b5c76165b68ad46fdcd454bc0 (patch)
treed72f100ec4195fbe64fe6f55c7a97dffa5be022c /Library/Homebrew/download_strategy.rb
parent4fe63cdb860b9497d06df010387c5227a2881994 (diff)
downloadhomebrew-bacc2b5e8f58238b5c76165b68ad46fdcd454bc0.tar.bz2
Reorder download strategy regexps by frequency
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
-rw-r--r--Library/Homebrew/download_strategy.rb43
1 files changed, 22 insertions, 21 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index e4628511a..0a80b8344 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -808,29 +808,30 @@ class DownloadStrategyDetector
def self.detect_from_url(url)
case url
- # We use a special URL pattern for cvs
- when %r[^cvs://] then CVSDownloadStrategy
- # Standard URLs
- when %r[^bzr://] then BazaarDownloadStrategy
- when %r[^git://] then GitDownloadStrategy
- when %r[^https?://.+\.git$] then GitDownloadStrategy
- when %r[^hg://] then MercurialDownloadStrategy
- when %r[^svn://] then SubversionDownloadStrategy
- when %r[^svn\+http://] then SubversionDownloadStrategy
- when %r[^fossil://] then FossilDownloadStrategy
- # Some well-known source hosts
- when %r[^https?://(.+?\.)?googlecode\.com/hg] then MercurialDownloadStrategy
- when %r[^https?://(.+?\.)?googlecode\.com/svn] then SubversionDownloadStrategy
- when %r[^https?://(.+?\.)?sourceforge\.net/svnroot/] then SubversionDownloadStrategy
- when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/] then MercurialDownloadStrategy
- when %r[^http://svn.apache.org/repos/] then SubversionDownloadStrategy
- when %r[^http://www.apache.org/dyn/closer.cgi] then CurlApacheMirrorDownloadStrategy
- # Common URL patterns
- when %r[^https?://svn\.] then SubversionDownloadStrategy
+ when %r[^https?://.+\.git$], %r[^git://]
+ GitDownloadStrategy
+ when %r[^http://www\.apache\.org/dyn/closer\.cgi]
+ CurlApacheMirrorDownloadStrategy
+ when %r[^https?://(.+?\.)?googlecode\.com/svn], %r[^https?://svn\.], %r[^svn://], %r[^https?://(.+?\.)?sourceforge\.net/svnroot/]
+ SubversionDownloadStrategy
+ when %r[^cvs://]
+ CVSDownloadStrategy
+ when %r[^https?://(.+?\.)?googlecode\.com/hg]
+ MercurialDownloadStrategy
+ when %r[^hg://]
+ MercurialDownloadStrategy
+ when %r[^bzr://]
+ BazaarDownloadStrategy
+ when %r[^fossil://]
+ FossilDownloadStrategy
+ when %r[^http://svn\.apache\.org/repos/], %r[^svn\+http://]
+ SubversionDownloadStrategy
+ when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/]
+ MercurialDownloadStrategy
when bottle_native_regex, bottle_regex
CurlBottleDownloadStrategy
- # Otherwise just try to download
- else CurlDownloadStrategy
+ else
+ CurlDownloadStrategy
end
end