Module: Homebrew::Bundle::TapDumper Private

Defined in:
bundle/tap_dumper.rb

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

Class Method Summary collapse

Class Method Details

.dumpObject

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.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'bundle/tap_dumper.rb', line 13

def self.dump
  taps.map do |tap|
    remote = if tap.custom_remote? && (tap_remote = tap.remote)
      if (api_token = ENV.fetch("HOMEBREW_GITHUB_API_TOKEN", false).presence)
        # Replace the API token in the remote URL with interpolation.
        # Rubocop's warning here is wrong; we intentionally want to not
        # evaluate this string until the Brewfile is evaluated.
        # rubocop:disable Lint/InterpolationCheck
        tap_remote = tap_remote.gsub api_token, '#{ENV.fetch("HOMEBREW_GITHUB_API_TOKEN")}'
        # rubocop:enable Lint/InterpolationCheck
      end
      ", \"#{tap_remote}\""
    end
    "tap \"#{tap.name}\"#{remote}"
  end.sort.uniq.join("\n")
end

.reset!Object

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.



9
10
11
# File 'bundle/tap_dumper.rb', line 9

def self.reset!
  @taps = nil
end

.tap_namesObject

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.



30
31
32
# File 'bundle/tap_dumper.rb', line 30

def self.tap_names
  taps.map(&:name)
end