aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-02-09 14:23:56 -0500
committerJack Nagel2014-02-09 14:23:56 -0500
commitf16003f58c4cccd28f4d275ed32c52498257dc2f (patch)
tree5bbb31d41abd5af8c826004109e802ae247663fa
parente93792fdefdf1ea09e9c38a7e5b03a04098e67ee (diff)
downloadbrew-f16003f58c4cccd28f4d275ed32c52498257dc2f.tar.bz2
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.
-rw-r--r--Library/Homebrew/requirements/x11_dependency.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/Library/Homebrew/requirements/x11_dependency.rb b/Library/Homebrew/requirements/x11_dependency.rb
index 5eb14354d..35e9be723 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