Class: Utils::Bottles::Collector Private

Inherits:
Object
  • Object
show all
Includes:
OS::Mac::Bottles::Collector
Defined in:
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

#initialize ⇒ 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.



395
396
397
# File 'utils/bottles.rb', line 395

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

Instance Method Details

#add(tag, checksum:, cellar:, manifest_checksum: nil) ⇒ 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:



418
419
420
421
# File 'utils/bottles.rb', line 418

def add(tag, checksum:, cellar:, manifest_checksum: nil)
  spec = Utils::Bottles::TagSpecification.new(tag:, checksum:, cellar:, manifest_checksum:)
  @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:



430
431
432
# File 'utils/bottles.rb', line 430

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

#find_matching_tag(tag, no_older_versions: false) ⇒ 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.

Parameters:

Returns:



444
445
446
447
448
449
450
451
# File 'utils/bottles.rb', line 444

def find_matching_tag(tag, no_older_versions: false)
  if @tag_specs.key?(tag)
    tag
  else
    all = Tag.from_symbol(:all)
    all if @tag_specs.key?(all)
  end
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:



438
439
440
441
# File 'utils/bottles.rb', line 438

def specification_for(tag, no_older_versions: false)
  tag = find_matching_tag(tag, 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)


424
425
426
427
# File 'utils/bottles.rb', line 424

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

#tags ⇒ Array<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.



400
401
402
# File 'utils/bottles.rb', line 400

def tags
  @tag_specs.keys
end