Class: Formulary::FormulaContentsLoader

Inherits:
FormulaLoader show all
Defined in:
brew/Library/Homebrew/formulary.rb

Overview

Load formulae directly from their contents.

Instance Attribute Summary collapse

Attributes inherited from FormulaLoader

#alias_path, #name, #path

Instance Method Summary collapse

Methods inherited from FormulaLoader

#get_formula

Constructor Details

#initialize(name, path, contents) ⇒ FormulaContentsLoader

Returns a new instance of FormulaContentsLoader



295
296
297
298
# File 'brew/Library/Homebrew/formulary.rb', line 295

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

Instance Attribute Details

#contentsObject (readonly)

The formula’s contents



293
294
295
# File 'brew/Library/Homebrew/formulary.rb', line 293

def contents
  @contents
end

Instance Method Details

#klassObject



300
301
302
303
304
# File 'brew/Library/Homebrew/formulary.rb', line 300

def klass
  $stderr.puts "#{$PROGRAM_NAME} (#{self.class.name}): loading #{path}" if ARGV.debug?
  namespace = "FormulaNamespace#{Digest::MD5.hexdigest(contents)}"
  Formulary.load_formula(name, path, contents, namespace)
end