Class: Utils::Bottles::Collector Private

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
utils/bottles.rb,
extend/os/mac/utils/bottles.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Collector for bottle specifications.

Instance Method Summary collapse

Constructor Details

#initializevoid

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



254
255
256
# File 'utils/bottles.rb', line 254

def initialize
  @tag_specs = T.let({}, T::Hash[Utils::Bottles::Tag, Utils::Bottles::TagSpecification])
end

Instance Method Details

#add(tag, checksum:, cellar:) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



264
265
266
267
# File 'utils/bottles.rb', line 264

def add(tag, checksum:, cellar:)
  spec = Utils::Bottles::TagSpecification.new(tag: tag, checksum: checksum, cellar: cellar)
  @tag_specs[tag] = spec
end

#each_tag(&block) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



276
277
278
# File 'utils/bottles.rb', line 276

def each_tag(&block)
  @tag_specs.each_key(&block)
end

#specification_for(tag, no_older_versions: false) ⇒ Utils::Bottles::TagSpecification?

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:



284
285
286
287
# File 'utils/bottles.rb', line 284

def specification_for(tag, no_older_versions: false)
  tag = find_matching_tag(tag, no_older_versions: no_older_versions)
  @tag_specs[tag] if tag
end

#tag?(tag, no_older_versions: false) ⇒ Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (Boolean)


270
271
272
273
# File 'utils/bottles.rb', line 270

def tag?(tag, no_older_versions: false)
  tag = find_matching_tag(tag, no_older_versions: no_older_versions)
  tag.present?
end

#tagsArray<Utils::Bottles::Tag>

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



259
260
261
# File 'utils/bottles.rb', line 259

def tags
  @tag_specs.keys
end