Class: Rinit::TemplateBuilder
- Inherits:
-
Object
- Object
- Rinit::TemplateBuilder
- Defined in:
- lib/rinit/template_builder.rb
Overview
Note:
only supports init and monit right now
simple template generator
Instance Method Summary collapse
- #build ⇒ nil
-
#initialize(opts = {}) ⇒ TemplateBuilder
constructor
A new instance of TemplateBuilder.
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
#build ⇒ 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 |