Skip to content

Commit

Permalink
Version.parse: return Version::NULL for unparseable strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Nov 10, 2016
1 parent 9bac107 commit fbcf500
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/test/testing_env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def assert_version_detected(expected, url, specs = {})
end

def assert_version_nil(url)
assert_nil Version.parse(url)
assert Version.parse(url).null?
end
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def tokenize

def self.parse(spec)
version = _parse(spec)
new(version) unless version.nil?
version.nil? ? NULL : new(version)
end

def self._parse(spec)
Expand Down

0 comments on commit fbcf500

Please sign in to comment.