Merge pull request #16130 from Bo98/bottle-equality
Implement equality functions for BottleSpecification
This commit is contained in:
commit
7b0d46850d
@ -535,6 +535,12 @@ class BottleSpecification
|
||||
end
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
self.class == other.class && rebuild == other.rebuild && collector == other.collector &&
|
||||
root_url == other.root_url && root_url_specs == other.root_url_specs && tap == other.tap
|
||||
end
|
||||
alias eql? ==
|
||||
|
||||
sig { params(tag: Utils::Bottles::Tag).returns(T.any(Symbol, String)) }
|
||||
def tag_to_cellar(tag = Utils::Bottles.tag)
|
||||
spec = collector.specification_for(tag)
|
||||
|
||||
@ -260,6 +260,11 @@ module Utils
|
||||
@checksum = checksum
|
||||
@cellar = cellar
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
self.class == other.class && tag == other.tag && checksum == other.checksum && cellar == other.cellar
|
||||
end
|
||||
alias eql? ==
|
||||
end
|
||||
|
||||
# Collector for bottle specifications.
|
||||
@ -274,6 +279,11 @@ module Utils
|
||||
@tag_specs.keys
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
self.class == other.class && @tag_specs == other.instance_variable_get(:@tag_specs)
|
||||
end
|
||||
alias eql? ==
|
||||
|
||||
sig { params(tag: Utils::Bottles::Tag, checksum: Checksum, cellar: T.any(Symbol, String)).void }
|
||||
def add(tag, checksum:, cellar:)
|
||||
spec = Utils::Bottles::TagSpecification.new(tag: tag, checksum: checksum, cellar: cellar)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user