aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorBaptiste Fontaine2016-02-17 12:26:45 +0100
committerBaptiste Fontaine2016-02-17 13:23:26 +0100
commit4c5aee7a5694c2935598c1ecfe72037c0c2ee14e (patch)
tree3dc4963e798372c6cd5086973179e6e747089cee /Library/Homebrew
parent270f6010508052cda7436d3da7919b5336961caf (diff)
downloadbrew-4c5aee7a5694c2935598c1ecfe72037c0c2ee14e.tar.bz2
version: fix GitHub releases URLs parsing
The current code doesn't work with releases that have more than one digit in the third group, i.e.: .../releases/download/1.2.3/... works .../releases/download/1.2.34/... doesn't work Closes Homebrew/homebrew#49255. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/test/test_versions.rb1
-rw-r--r--Library/Homebrew/version.rb3
2 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb
index d88d89b6c..f8b25fea1 100644
--- a/Library/Homebrew/test/test_versions.rb
+++ b/Library/Homebrew/test/test_versions.rb
@@ -316,6 +316,7 @@ class VersionParsingTests < Homebrew::TestCase
def test_jenkins_version_style
assert_version_detected "1.486", "http://mirrors.jenkins-ci.org/war/1.486/jenkins.war"
+ assert_version_detected "0.10.11", "https://github.com/hechoendrupal/DrupalConsole/releases/download/0.10.11/drupal.phar"
end
def test_apache_version_style
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index 6345676c3..93f548b34 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -368,7 +368,8 @@ class Version
return m.captures.first unless m.nil?
# e.g. http://mirrors.jenkins-ci.org/war/1.486/jenkins.war
- m = /\/(\d\.\d+(\.\d)?)\//.match(spec_s)
+ # e.g. https://github.com/foo/bar/releases/download/0.10.11/bar.phar
+ m = /\/(\d\.\d+(\.\d+)?)\//.match(spec_s)
return m.captures.first unless m.nil?
# e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz