Allow multiple macOS requirements

This commit is contained in:
Bo Anderson 2022-11-09 01:19:46 +00:00
parent c33b5b257e
commit 9eac310468
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
2 changed files with 10 additions and 1 deletions

View File

@ -126,7 +126,7 @@ class Requirement
alias eql? ==
def hash
[name, tags].hash
[self.class, name, tags].hash
end
sig { returns(String) }

View File

@ -88,6 +88,15 @@ class MacOSRequirement < Requirement
end
end
def ==(other)
super(other) && comparator == other.comparator && version == other.version
end
alias eql? ==
def hash
[super, comparator, version].hash
end
sig { returns(String) }
def inspect
"#<#{self.class.name}: version#{@comparator}#{@version.to_s.inspect} #{tags.inspect}>"