Class: Formulary::FormulaContentsLoader 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.

Load formulae directly from their contents.

Instance Attribute Summary collapse

Attributes inherited from FormulaLoader

#alias_path, #name, #path, #tap

Instance Method Summary collapse

Methods inherited from FormulaLoader

#get_formula

Methods included from Context

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

Constructor Details

#initialize(name, path, contents) ⇒ FormulaContentsLoader

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 FormulaContentsLoader.



900
901
902
903
# File 'formulary.rb', line 900

def initialize(name, path, contents)
  @contents = contents
  super name, path
end

Instance Attribute Details

#contentsObject (readonly)

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.

The formula's contents.



898
899
900
# File 'formulary.rb', line 898

def contents
  @contents
end

Instance Method Details

#klass(flags:, ignore_errors:) ⇒ Object

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.



905
906
907
908
# File 'formulary.rb', line 905

def klass(flags:, ignore_errors:)
  namespace = "FormulaNamespace#{Digest::MD5.hexdigest(contents.to_s)}"
  Formulary.load_formula(name, path, contents, namespace, flags:, ignore_errors:)
end