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:
parent
e93792fdef
commit
f16003f58c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user