Class: Rinit::TemplateBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rinit/template_builder.rb

Overview

Note:

only supports init and monit right now

simple template generator

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ TemplateBuilder

Returns a new instance of TemplateBuilder.



8
9
10
11
# File 'lib/rinit/template_builder.rb', line 8

def initialize(opts={})
  @template = opts.fetch(:template) { 'init' }
  @name = opts.fetch(:name) { 'foobar' }
end

Instance Method Details

#buildnil

Returns:

  • (nil)


15
16
17
18
# File 'lib/rinit/template_builder.rb', line 15

def build
  @erb_temp = ERB.new(File.read(template_file)) #.result(binding)
  write_out_file
end