aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-06-16 14:19:01 +0100
committerGitHub2017-06-16 14:19:01 +0100
commit3b376bfa2f8d3e61dc1164304d4f8d64de6e6014 (patch)
tree2c7e87961a5bf55ce547a4a1174a70e2d0c0c032 /Library
parente5856a9f55fc3f405f071465d0d71f270b4e7aaa (diff)
parent7dca9a13ee59b55e4074770090127ebd6787267e (diff)
downloadbrew-3b376bfa2f8d3e61dc1164304d4f8d64de6e6014.tar.bz2
Merge pull request #2761 from sjackman/bottleloader-url-homebrew
BottleLoader: Fix installing a bottle from an URL
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formulary.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index a0ccb9ba0..195d15cec 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -108,7 +108,8 @@ module Formulary
case bottle_name
when %r{(https?|ftp|file)://}
# The name of the formula is found between the last slash and the last hyphen.
- resource = Resource.new bottle_name[%r{([^/]+)-}, 1] { url bottle_name }
+ formula_name = File.basename(bottle_name)[/(.+)-/, 1]
+ resource = Resource.new(formula_name) { url bottle_name }
downloader = CurlBottleDownloadStrategy.new resource.name, resource
@bottle_filename = downloader.cached_location
cached = @bottle_filename.exist?