module Drupid::DownloadStrategy

Public Class Methods

detect(url) click to toggle source
   # File lib/drupid/download_strategy.rb
69 def self.detect url
70   case url
71   when %r[^file://] then Curl
72     # We use a special URL pattern for cvs
73   when %r[^cvs://] then CVS
74     # Standard URLs
75   when %r[^bzr://] then Bazaar
76   when %r[^git://] then Git
77   when %r[^https?://.+\.git$] then Git
78   when %r[^hg://] then Mercurial
79   when %r[^svn://] then Subversion
80   when %r[^svn\+http://] then Subversion
81   when %r[^fossil://] then Fossil
82     # Some well-known source hosts
83   when %r[^https?://(.+?\.)?googlecode\.com/hg] then Mercurial
84   when %r[^https?://(.+?\.)?googlecode\.com/svn] then Subversion
85   when %r[^https?://(.+?\.)?sourceforge\.net/svnroot/] then Subversion
86   when %r[^http://svn.apache.org/repos/] then Subversion
87   when %r[^http://www.apache.org/dyn/closer.cgi] then CurlApacheMirror
88     # Common URL patterns
89   when %r[^https?://svn\.] then Subversion
90   when %r[\.git$] then Git
91   when %r[\/] then Curl
92   else Curl
93   end
94 end