X11Dependency: return nil instead of raising in #<=>

Returning nil is in the contract of the Comparable module, and a future
version of Ruby will no longer hide this error.
This commit is contained in:
Jack Nagel 2014-02-09 14:23:56 -05:00
parent e93792fdef
commit f16003f58c

View File

@ -27,9 +27,7 @@ class X11Dependency < Requirement
end
def <=> other
unless other.is_a? X11Dependency
raise TypeError, "expected X11Dependency"
end
return nil unless X11Dependency === other
if min_version.nil? && other.min_version.nil?
0