brew/Library/Homebrew/bottle_version.rb

18 lines
501 B
Ruby
Raw Normal View History

2013-08-03 20:02:10 -07:00
class BottleVersion < Version
def self._parse spec
spec = Pathname.new(spec) unless spec.is_a? Pathname
stem = spec.stem
# e.g. perforce-2013.1.610569-x86_64.mountain_lion.bottle.tar.gz
m = /-([\d\.]+-x86(_64)?)/.match(stem)
return m.captures.first unless m.nil?
# e.g. ssh-copy-id-6.2p2.mountain_lion.bottle.tar.gz
# e.g. icu4c-52.1.mountain_lion.bottle.tar.gz
2013-10-11 08:40:08 +01:00
m = /(\d+\.(\d)+(p(\d)+)?)/.match(stem)
return m.captures.first unless m.nil?
2013-08-03 20:02:10 -07:00
super
end
end