Remove special case for now-deprecated GitHub URLs
This commit is contained in:
		
							parent
							
								
									07003f43ca
								
							
						
					
					
						commit
						22038d5269
					
				@ -203,18 +203,12 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def ext
 | 
					  def ext
 | 
				
			||||||
    # GitHub uses odd URLs for zip files, so check for those
 | 
					    # We need a Pathname because we've monkeypatched extname to support double
 | 
				
			||||||
    rx=%r[https?://(www\.)?github\.com/.*/(zip|tar)ball/]
 | 
					    # extensions (e.g. tar.gz).
 | 
				
			||||||
    if rx.match @url
 | 
					    # We can't use basename_without_params, because given a URL like
 | 
				
			||||||
      if $2 == 'zip'
 | 
					    #   http://example.com/download.php?file=foo-1.0.tar.gz
 | 
				
			||||||
        '.zip'
 | 
					    # the extension we want is ".tar.gz", not ".php".
 | 
				
			||||||
      else
 | 
					    Pathname.new(@url).extname[/[^?]+/]
 | 
				
			||||||
        '.tgz'
 | 
					 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
      # Strip any ?thing=wad out of .c?thing=wad style extensions
 | 
					 | 
				
			||||||
      (Pathname.new(@url).extname)[/[^?]+/]
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user