Class: ElfManifesto::ManifestMaker

Inherits:
Object
  • Object
show all
Defined in:
lib/elf_manifesto/manifest_maker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ops) ⇒ ManifestMaker

template

String -> template file to load

[properties] Hash -> arbitrary properties to supply to template [globs] Array -> list of file globs to evaluate



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/elf_manifesto/manifest_maker.rb', line 23

def initialize(ops)
  @file_groups = get_file_groups(ops[:globs]) # evaluate the globs and create the file groups
  @file_groups[:props] = ops[:props] unless ops[:props].nil?
  template_file = File.open ops[:template], 'rb'
  @template = template_file.read
  @result = Mustache.render @template, @file_groups
  message = ""
  pos = 1
  # puts "#{message}\n\n\n"
  puts @result
end

Instance Attribute Details

#file_groupsObject (readonly)

Returns the value of attribute file_groups.



8
9
10
# File 'lib/elf_manifesto/manifest_maker.rb', line 8

def file_groups
  @file_groups
end

#resultObject (readonly)

Returns the value of attribute result.



8
9
10
# File 'lib/elf_manifesto/manifest_maker.rb', line 8

def result
  @result
end