Module: Homebrew::Bundle::Checker Private

Defined in:
bundle/checker.rb,
bundle/go_checker.rb,
bundle/tap_checker.rb,
bundle/brew_checker.rb,
bundle/cask_checker.rb,
bundle/flatpak_checker.rb,
bundle/brew_service_checker.rb,
bundle/mac_app_store_checker.rb,
bundle/vscode_extension_checker.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.

Defined Under Namespace

Classes: Base, BrewChecker, BrewServiceChecker, CaskChecker, CheckResult, FlatpakChecker, GoChecker, MacAppStoreChecker, TapChecker, VscodeExtensionChecker

Constant Summary collapse

CHECKS =

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

{
  taps_to_tap:            "Taps",
  casks_to_install:       "Casks",
  extensions_to_install:  "VSCode Extensions",
  apps_to_install:        "Apps",
  formulae_to_install:    "Formulae",
  formulae_to_start:      "Services",
  go_packages_to_install: "Go Packages",
  flatpaks_to_install:    "Flatpaks",
}.freeze

Class Method Summary collapse

Class Method Details

.apps_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



118
119
120
121
122
123
124
# File 'bundle/checker.rb', line 118

def self.apps_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/mac_app_store_checker"
  Homebrew::Bundle::Checker::MacAppStoreChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
end

.casks_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



94
95
96
97
98
99
100
# File 'bundle/checker.rb', line 94

def self.casks_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/cask_checker"
  Homebrew::Bundle::Checker::CaskChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
end

.check(global: false, file: nil, exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'bundle/checker.rb', line 72

def self.check(global: false, file: nil, exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/brewfile"
  @dsl ||= Brewfile.read(global:, file:)

  check_method_names = CHECKS.keys

  errors = []
  enumerator = exit_on_first_error ? :find : :map

  work_to_be_done = check_method_names.public_send(enumerator) do |check_method|
    check_errors =
      send(check_method, exit_on_first_error:, no_upgrade:, verbose:)
    any_errors = check_errors.any?
    errors.concat(check_errors) if any_errors
    any_errors
  end

  work_to_be_done = Array(work_to_be_done).flatten.any?

  CheckResult.new work_to_be_done, errors
end

.extensions_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



126
127
128
129
130
131
132
# File 'bundle/checker.rb', line 126

def self.extensions_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/vscode_extension_checker"
  Homebrew::Bundle::Checker::VscodeExtensionChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
end

.flatpaks_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



150
151
152
153
154
155
156
# File 'bundle/checker.rb', line 150

def self.flatpaks_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/flatpak_checker"
  Homebrew::Bundle::Checker::FlatpakChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
end

.formulae_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



102
103
104
105
106
107
108
# File 'bundle/checker.rb', line 102

def self.formulae_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/brew_checker"
  Homebrew::Bundle::Checker::BrewChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
end

.formulae_to_start(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



134
135
136
137
138
139
140
# File 'bundle/checker.rb', line 134

def self.formulae_to_start(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/brew_service_checker"
  Homebrew::Bundle::Checker::BrewServiceChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
end

.go_packages_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



142
143
144
145
146
147
148
# File 'bundle/checker.rb', line 142

def self.go_packages_to_install(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/go_checker"
  Homebrew::Bundle::Checker::GoChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
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.



158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'bundle/checker.rb', line 158

def self.reset!
  require "bundle/cask_dumper"
  require "bundle/formula_dumper"
  require "bundle/mac_app_store_dumper"
  require "bundle/tap_dumper"
  require "bundle/brew_services"

  @dsl = nil
  Homebrew::Bundle::CaskDumper.reset!
  Homebrew::Bundle::FormulaDumper.reset!
  Homebrew::Bundle::MacAppStoreDumper.reset!
  Homebrew::Bundle::TapDumper.reset!
  Homebrew::Bundle::BrewServices.reset!
end

.taps_to_tap(exit_on_first_error: false, no_upgrade: false, verbose: false) ⇒ 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.



110
111
112
113
114
115
116
# File 'bundle/checker.rb', line 110

def self.taps_to_tap(exit_on_first_error: false, no_upgrade: false, verbose: false)
  require "bundle/tap_checker"
  Homebrew::Bundle::Checker::TapChecker.new.find_actionable(
    @dsl.entries,
    exit_on_first_error:, no_upgrade:, verbose:,
  )
end