Module: Charmkit::Helpers

Defined in:
lib/charmkit/helpers/runner.rb,
lib/charmkit/helpers/template.rb

Defined Under Namespace

Classes: TemplateRenderer

Instance Method Summary collapse

Instance Method Details

#run(*cmd) ⇒ Object



5
6
7
8
# File 'lib/charmkit/helpers/runner.rb', line 5

def run(*cmd)
  runner = TTY::Command.new
  return runner.run(*cmd)
end

#template(src, dst, **context) ⇒ Object



20
21
22
23
# File 'lib/charmkit/helpers/template.rb', line 20

def template(src, dst, **context)
  rendered = TemplateRenderer.render(File.read(src), context)
  File.write(dst, rendered)
end