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)


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

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:



154
155
156
# File 'utils/path.rb', line 154

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:



178
179
180
# File 'utils/path.rb', line 178

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:



162
163
164
# File 'utils/path.rb', line 162

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:



170
171
172
# File 'utils/path.rb', line 170

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:



146
147
148
# File 'utils/path.rb', line 146

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