class MCG::Action

Public Class Methods

new(template, output, reload_command) click to toggle source
# File lib/mcg/action.rb, line 7
def initialize(template, output, reload_command)
    @template = IO.read(template)
    @output = output
    @reload_command = reload_command
end

Public Instance Methods

render(data) click to toggle source
# File lib/mcg/action.rb, line 13
def render(data)
    @data = data
    b = binding
    renderer = ERB.new(@template)
    IO.write(@output, renderer.result(b))
    `#{@reload_command}`
end