BottleVersion: add imap-uw style versions

This commit is contained in:
Tim D. Smith 2014-11-02 18:23:09 -08:00
parent 6eabbed464
commit f5a54ab349
2 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,10 @@ class BottleVersion < Version
m = /-(\d{8})/.match(stem)
return m.captures.first unless m.nil?
# e.g. 2007f from imap-uw-2007f.yosemite.bottle.tar.gz
m = /-(\d+[a-z])/.match(stem)
return m.captures.first unless m.nil?
super
end
end

View File

@ -60,4 +60,9 @@ class BottleVersionParsingTests < Homebrew::TestCase
assert_version_detected '13-2.9.19',
'libpano-13-2.9.19_1.yosemite.bottle.tar.gz'
end
def test_imapuw_style
assert_version_detected '2007f',
'imap-uw-2007f.yosemite.bottle.tar.gz'
end
end