Module: Utils::Path::FormulaHelpers Private

Included in:
Utils::Path, Utils::Path
Defined in:
utils/path.rb

Overview

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.

Public Formula and Cask DSL path helpers.

Instance Method Summary collapse

Instance Method Details

#formula_any_version_installed?(formula_names) ⇒ Boolean

Whether any installed keg for one or more formula names has an install receipt.

Parameters:

Returns:

  • (Boolean)


227
228
229
230
231
# File 'utils/path.rb', line 227

def formula_any_version_installed?(formula_names)
  Utils::Path.formula_installed_prefixes(formula_names).any? do |keg|
    (keg/"INSTALL_RECEIPT.json").file?
  end
end

#formula_opt_bin(formula_name) ⇒ Pathname

The bin directory under the stable install path for a given formula name.

Parameters:

Returns:



195
196
197
# File 'utils/path.rb', line 195

def formula_opt_bin(formula_name)
  formula_opt_prefix(formula_name)/"bin"
end

#formula_opt_include(formula_name) ⇒ Pathname

The include directory under the stable install path for a given formula name.

Parameters:

Returns:



219
220
221
# File 'utils/path.rb', line 219

def formula_opt_include(formula_name)
  formula_opt_prefix(formula_name)/"include"
end

#formula_opt_lib(formula_name) ⇒ Pathname

The lib directory under the stable install path for a given formula name.

Parameters:

Returns:



203
204
205
# File 'utils/path.rb', line 203

def formula_opt_lib(formula_name)
  formula_opt_prefix(formula_name)/"lib"
end

#formula_opt_libexec(formula_name) ⇒ Pathname

The libexec directory under the stable install path for a given formula name.

Parameters:

Returns:



211
212
213
# File 'utils/path.rb', line 211

def formula_opt_libexec(formula_name)
  formula_opt_prefix(formula_name)/"libexec"
end

#formula_opt_prefix(formula_name) ⇒ Pathname

The stable install path for a given formula name.

Parameters:

Returns:



187
188
189
# File 'utils/path.rb', line 187

def formula_opt_prefix(formula_name)
  HOMEBREW_PREFIX/"opt/#{Utils.name_from_full_name(formula_name)}"
end