bottle_versions: add perforce bottle detection.

This commit is contained in:
Mike McQuaid committed 2013-08-03 22:27:42 -07:00
1 parent ee972d943b
commit 36dcc6ba02
2 files changed
+9

No files matched your search

+4
View File
@@ -3,6 +3,10 @@ class BottleVersion < Version
spec = Pathname.new(spec) unless spec.is_a? Pathname
stem = spec.stem
# e.g. perforce-2013.1.610569-x86_64
m = /-([\d\.]+-x86(_64)?)/.match(stem)
return m.captures.first unless m.nil?
super
end
end
@@ -5,4 +5,9 @@ class BottleVersionParsingTests < Test::Unit::TestCase
def assert_version_detected expected, path
assert_equal expected, BottleVersion.parse(path).to_s
end
def test_perforce_style
assert_version_detected '2013.1.610569-x86_64',
'/usr/local/perforce-2013.1.610569-x86_64.mountain_lion.bottle.tar.gz'
end
end