Class: Formulary::NullLoader Private

Inherits:
FormulaLoader show all
Defined in:
formulary.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Pseudo-loader which will raise a FormulaUnavailableError when trying to load the corresponding formula.

Instance Attribute Summary

Attributes inherited from FormulaLoader

#alias_path, #name, #path

Instance Method Summary collapse

Methods inherited from FormulaLoader

#klass

Methods included from Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Constructor Details

#initialize(name) ⇒ NullLoader

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 a new instance of NullLoader.



365
366
367
# File 'formulary.rb', line 365

def initialize(name)
  super name, Formulary.core_path(name)
end

Instance Method Details

#get_formulaObject

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.



369
370
371
372
373
374
375
# File 'formulary.rb', line 369

def get_formula(*)
  if !CoreTap.instance.installed? && Homebrew::EnvConfig.install_from_api?
    raise CoreTapFormulaUnavailableError, name
  end

  raise FormulaUnavailableError, name
end