Support gloox version style

This commit is contained in:
Max Howell 2009-07-10 03:11:05 +01:00
parent 3bdeac3649
commit 17968f51c4
2 changed files with 9 additions and 0 deletions

View File

@ -73,6 +73,10 @@ def extract_version basename
/-((\d+\.)*\d+([abc]|rc\d))$/.match basename
return $1 if $1
# eg foobar-4.5.0-beta1
/-((\d+\.)*\d+-beta\d+)$/.match basename
return $1 if $1
# eg. foobar4.5.1
/((\d+\.)*\d+)$/.match basename
return $1 if $1

View File

@ -47,6 +47,11 @@ class BeerTasting <Test::Unit::TestCase
assert_equal '9.04', r.version
end
def test_gloox_beta_style
r=TestFormula.new "http://camaya.net/download/gloox-1.0-beta7.tar.bz2"
assert_equal '1.0-beta7', r.version
end
def test_astyle_verson_style
r=TestFormula.new "http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz"
assert_equal '1.23', r.version