diff options
| author | Jack Nagel | 2014-07-17 15:14:16 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-17 15:18:13 -0500 |
| commit | 22038d5269d591ecc6646eba8b474d6320f7c476 (patch) | |
| tree | c706b7a2d31b32cbd5274d301a2798a90426d1cc | |
| parent | 07003f43caf6345a18858fd82c320623ebf42ae3 (diff) | |
| download | brew-22038d5269d591ecc6646eba8b474d6320f7c476.tar.bz2 | |
Remove special case for now-deprecated GitHub URLs
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 859e09d40..06d37de66 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -203,18 +203,12 @@ class CurlDownloadStrategy < AbstractDownloadStrategy end def ext - # GitHub uses odd URLs for zip files, so check for those - rx=%r[https?://(www\.)?github\.com/.*/(zip|tar)ball/] - if rx.match @url - if $2 == 'zip' - '.zip' - else - '.tgz' - end - else - # Strip any ?thing=wad out of .c?thing=wad style extensions - (Pathname.new(@url).extname)[/[^?]+/] - end + # We need a Pathname because we've monkeypatched extname to support double + # extensions (e.g. tar.gz). + # We can't use basename_without_params, because given a URL like + # http://example.com/download.php?file=foo-1.0.tar.gz + # the extension we want is ".tar.gz", not ".php". + Pathname.new(@url).extname[/[^?]+/] end end |
