bottle_versions: add perforce bottle detection.
This commit is contained in:
parent
cfdd23b3ef
commit
b507536f80
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user