Fixed recognition of versions like 'foobar-4.50-beta' in Pathname#version
Sphinx currently has a download name 'http://sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz', which homebrew currently can't correctly identify - with a small change to the regex for 'foobar-4.5.0-beta1' (make that trailing number optional) - it works like a charm. Signed-off-by: David Höppner <0xffea@gmail.com>
This commit is contained in:
parent
4f56674c72
commit
bd6fb10361
@ -134,8 +134,8 @@ class Pathname
|
|||||||
/-((\d+\.)*\d+([abc]|rc|RC)\d*)$/.match stem
|
/-((\d+\.)*\d+([abc]|rc|RC)\d*)$/.match stem
|
||||||
return $1 if $1
|
return $1 if $1
|
||||||
|
|
||||||
# eg foobar-4.5.0-beta1
|
# eg foobar-4.5.0-beta1, or foobar-4.50-beta
|
||||||
/-((\d+\.)*\d+-beta\d+)$/.match stem
|
/-((\d+\.)*\d+-beta(\d+)?)$/.match stem
|
||||||
return $1 if $1
|
return $1 if $1
|
||||||
|
|
||||||
# eg. foobar4.5.1
|
# eg. foobar4.5.1
|
||||||
|
@ -65,6 +65,10 @@ class VersionTests < Test::Unit::TestCase
|
|||||||
check "http://camaya.net/download/gloox-1.0-beta7.tar.bz2", '1.0-beta7'
|
check "http://camaya.net/download/gloox-1.0-beta7.tar.bz2", '1.0-beta7'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_sphinx_beta_style
|
||||||
|
check 'http://sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz', '1.10-beta'
|
||||||
|
end
|
||||||
|
|
||||||
def test_astyle_verson_style
|
def test_astyle_verson_style
|
||||||
check "http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz",
|
check "http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz",
|
||||||
'1.23'
|
'1.23'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user