Merge pull request #14122 from Bo98/multiple-macos

Allow multiple macOS requirements
This commit is contained in:
Bo Anderson 2022-11-09 12:13:38 +00:00 committed by GitHub
commit d3852122ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

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

View File

@ -88,6 +88,15 @@ class MacOSRequirement < Requirement
end end
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) } sig { returns(String) }
def inspect def inspect
"#<#{self.class.name}: version#{@comparator}#{@version.to_s.inspect} #{tags.inspect}>" "#<#{self.class.name}: version#{@comparator}#{@version.to_s.inspect} #{tags.inspect}>"