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)


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

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:



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

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:



193
194
195
# File 'utils/path.rb', line 193

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:



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

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:



185
186
187
# File 'utils/path.rb', line 185

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:



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

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