From f87fadd4ee7a5f157df6813c233b9e8684a66a4b Mon Sep 17 00:00:00 2001 From: JCount Date: Mon, 26 Jun 2017 16:16:45 -0400 Subject: [PATCH] version: improve parsing of url-only, non-filename versions add support for styles prefixed with a r,v,V and an optional _ , and styles with four groups of digits, seperated by periods; combinations of the two are also supported --- Library/Homebrew/version.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index f99914c4dc..5e8ba7a436 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -407,8 +407,13 @@ class Version # e.g. http://mirrors.jenkins-ci.org/war/1.486/jenkins.war # e.g. https://github.com/foo/bar/releases/download/0.10.11/bar.phar - m = %r{/(\d\.\d+(\.\d+)?)}.match(spec_s) - return m.captures.first unless m.nil? + # e.g. https://github.com/clojure/clojurescript/releases/download/r1.9.293/cljs.jar + # e.g. https://github.com/fibjs/fibjs/releases/download/v0.6.1/fullsrc.zip + # e.g. https://wwwlehre.dhbw-stuttgart.de/~sschulz/WORK/E_DOWNLOAD/V_1.9/E.tgz + # e.g. https://github.com/JustArchi/ArchiSteamFarm/releases/download/2.3.2.0/ASF.zip + # e.g. https://people.gnome.org/~newren/eg/download/1.7.5.2/eg + m = %r{/([rvV]_?)?(\d\.\d+(\.\d+){,2})}.match(spec_s) + return m.captures[1] unless m.nil? # e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz m = /\.v(\d+[a-z]?)/.match(stem)