Version.parse: return Version::NULL for unparseable strings
This commit is contained in:
parent
9bac107b31
commit
fbcf500a48
@ -36,7 +36,7 @@ module Homebrew
|
||||
end
|
||||
|
||||
def assert_version_nil(url)
|
||||
assert_nil Version.parse(url)
|
||||
assert Version.parse(url).null?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -287,7 +287,7 @@ class Version
|
||||
|
||||
def self.parse(spec)
|
||||
version = _parse(spec)
|
||||
new(version) unless version.nil?
|
||||
version.nil? ? NULL : new(version)
|
||||
end
|
||||
|
||||
def self._parse(spec)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user