Class: Formulary::FormulaContentsLoader

Inherits:
FormulaLoader show all
Defined in:
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



261
262
263
264
# File 'Library/Homebrew/formulary.rb', line 261

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

Instance Attribute Details

#contentsObject (readonly)

The formula's contents



259
260
261
# File 'Library/Homebrew/formulary.rb', line 259

def contents
  @contents
end

Instance Method Details

#klassObject



266
267
268
269
270
# File 'Library/Homebrew/formulary.rb', line 266

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