bottle_version: support lz4 style.

This commit is contained in:
Mike McQuaid 2014-03-17 10:35:53 +00:00
parent 6060ffd5ce
commit f115260a29
2 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,8 @@ class BottleVersion < Version
return m.captures.first unless m.nil?
# e.g. x264-r2197.4.mavericks.bottle.tar.gz
m = /(r\d+\.\d)/.match(stem)
# e.g. lz4-r114.mavericks.bottle.tar.gz
m = /(r\d+\.?\d*)/.match(stem)
return m.captures.first unless m.nil?
# e.g. ssh-copy-id-6.2p2.mountain_lion.bottle.tar.gz

View File

@ -25,4 +25,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase
assert_version_detected 'r2197.4',
'/usr/local/x264-r2197.4.mavericks.bottle.tar.gz'
end
def test_lz4_style
assert_version_detected 'r114',
'/usr/local/lz4-r114.mavericks.bottle.tar.gz'
end
end