aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/requirements
diff options
context:
space:
mode:
authorJack Nagel2014-02-09 14:23:56 -0500
committerJack Nagel2014-02-09 14:23:56 -0500
commitce3ae1fd92139044919e027516bd5ded161fd819 (patch)
tree22379bbd428d80b2c0b988819568e07841411800 /Library/Homebrew/requirements
parentaee5c113bf706938dd8863e9facf2d3722a516ef (diff)
downloadhomebrew-ce3ae1fd92139044919e027516bd5ded161fd819.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.
Diffstat (limited to 'Library/Homebrew/requirements')
-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