class Nymphia::DSL

Public Class Methods

new(dsl_code, path) click to toggle source
# File lib/nymphia/dsl.rb, line 6
def initialize(dsl_code, path)
  @dsl_code = dsl_code
  @path = path
end

Public Instance Methods

compile() click to toggle source
# File lib/nymphia/dsl.rb, line 11
def compile
  @result = Nymphia::DSL::Context.eval(@dsl_code, @path).result
end
render(output) click to toggle source
# File lib/nymphia/dsl.rb, line 15
def render(output)
  ssh_config = ERB.new(File.read(find_template('ssh_config_template.erb')), nil, '-').result(binding)
  output.write(ssh_config)
end

Private Instance Methods

find_template(filename) click to toggle source
# File lib/nymphia/dsl.rb, line 22
def find_template(filename)
  Pathname.new(__FILE__).dirname.join(filename)
end