Module: Homebrew::API::Formula Private

Extended by:
T::Sig
Defined in:
api/formula.rb,
extend/os/linux/api/formula.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.

Helper functions for using the formula JSON API.

Class Method Summary collapse

Class Method Details

.fetch(name) ⇒ Hash

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.

Parameters:

Returns:

  • (Hash)


20
21
22
# File 'api/formula.rb', line 20

def fetch(name)
  Homebrew::API.fetch "#{formula_api_path}/#{name}.json"
end

.formula_api_pathString Also known as: generic_formula_api_path

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.

Returns:



14
15
16
17
18
19
20
# File 'api/formula.rb', line 14

def formula_api_path
  return generic_formula_api_path if
    Homebrew::EnvConfig.force_homebrew_on_linux? ||
    Homebrew::EnvConfig.force_homebrew_core_repo_on_linux?

  "formula-linux"
end