Implement equality functions for BottleSpecification
This commit is contained in:
parent
35746e0a6b
commit
de83bc69e0
@ -535,6 +535,12 @@ class BottleSpecification
|
|||||||
end
|
end
|
||||||
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)) }
|
sig { params(tag: Utils::Bottles::Tag).returns(T.any(Symbol, String)) }
|
||||||
def tag_to_cellar(tag = Utils::Bottles.tag)
|
def tag_to_cellar(tag = Utils::Bottles.tag)
|
||||||
spec = collector.specification_for(tag)
|
spec = collector.specification_for(tag)
|
||||||
|
|||||||
@ -260,6 +260,11 @@ module Utils
|
|||||||
@checksum = checksum
|
@checksum = checksum
|
||||||
@cellar = cellar
|
@cellar = cellar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ==(other)
|
||||||
|
self.class == other.class && tag == other.tag && checksum == other.checksum && cellar == other.cellar
|
||||||
|
end
|
||||||
|
alias eql? ==
|
||||||
end
|
end
|
||||||
|
|
||||||
# Collector for bottle specifications.
|
# Collector for bottle specifications.
|
||||||
@ -274,6 +279,11 @@ module Utils
|
|||||||
@tag_specs.keys
|
@tag_specs.keys
|
||||||
end
|
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 }
|
sig { params(tag: Utils::Bottles::Tag, checksum: Checksum, cellar: T.any(Symbol, String)).void }
|
||||||
def add(tag, checksum:, cellar:)
|
def add(tag, checksum:, cellar:)
|
||||||
spec = Utils::Bottles::TagSpecification.new(tag: tag, checksum: checksum, cellar: cellar)
|
spec = Utils::Bottles::TagSpecification.new(tag: tag, checksum: checksum, cellar: cellar)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user