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)


230
231
232
233
234
# File 'utils/path.rb', line 230

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:



198
199
200
# File 'utils/path.rb', line 198

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:



222
223
224
# File 'utils/path.rb', line 222

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:



206
207
208
# File 'utils/path.rb', line 206

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:



214
215
216
# File 'utils/path.rb', line 214

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:



190
191
192
# File 'utils/path.rb', line 190

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