bottle_version: support fontforge scheme.

This commit is contained in:
Mike McQuaid 2014-05-15 11:00:58 +01:00
parent d6483c963a
commit 6ef3bab4a3
2 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,10 @@ class BottleVersion < Version
m = /-(\d+_\d+(_\d+)+)/.match(stem)
return m.captures.first unless m.nil?
# e.g. 20120731 from fontforge-20120731.mavericks.bottle.tar.gz
m = /-(\d+)/.match(stem)
return m.captures.first unless m.nil?
super
end
end

View File

@ -45,4 +45,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase
assert_version_detected '00-5.0.5',
'/usr/local/zpython-00-5.0.5.mavericks.bottle.tar.gz'
end
def test_fontforge_style
assert_version_detected '20120731',
'/usr/local/fontforge-20120731.mavericks.bottle.tar.gz'
end
end