bottle_versions: add ssh_copy_id bottle detection.

This commit is contained in:
Mike McQuaid 2013-08-03 20:03:58 -07:00
parent b507536f80
commit 98c3d39e65
2 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,10 @@ class BottleVersion < Version
m = /-([\d\.]+-x86(_64)?)/.match(stem)
return m.captures.first unless m.nil?
# e.g. ssh-copy-id-6.2p2.bottle.tar.gz
m = /(\d\.(\d)+(p(\d)+)?)/.match(stem)
return m.captures.first unless m.nil?
super
end
end

View File

@ -10,4 +10,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase
assert_version_detected '2013.1.610569-x86_64',
'/usr/local/perforce-2013.1.610569-x86_64.mountain_lion.bottle.tar.gz'
end
def test_ssh_copy_id_style
assert_version_detected '6.2p2',
'/usr/local/ssh-copy-id-6.2p2.mountain_lion.bottle.tar.gz'
end
end