From f16003f58c4cccd28f4d275ed32c52498257dc2f Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 9 Feb 2014 14:23:56 -0500 Subject: [PATCH] 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. --- Library/Homebrew/requirements/x11_dependency.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Library/Homebrew/requirements/x11_dependency.rb b/Library/Homebrew/requirements/x11_dependency.rb index 5eb14354dc..35e9be723e 100644 --- a/Library/Homebrew/requirements/x11_dependency.rb +++ b/Library/Homebrew/requirements/x11_dependency.rb @@ -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