diff options
Diffstat (limited to 'Library/Homebrew/dependencies.rb')
| -rw-r--r-- | Library/Homebrew/dependencies.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 8b4916279..623591c78 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -145,27 +145,23 @@ class Dependency def initialize(name, *tags) @name = name - @tags = [tags].flatten.compact - end - - def hash - @name.hash + @tags = tags.flatten.compact end def to_s - @name + name end def ==(other) - @name == other.to_s + name == other.name end - def <=>(other) - @name <=> other.to_s + def eql?(other) + other.is_a?(self.class) && hash == other.hash end - def eql?(other) - other.is_a? self.class and hash == other.hash + def hash + name.hash end end @@ -199,7 +195,7 @@ class Requirement end def eql?(other) - other.is_a? self.class and hash == other.hash + other.is_a?(self.class) && hash == other.hash end def hash |
