class Lyra::Template

Attributes

output_path[R]
secrets[R]
template_path[R]

Public Class Methods

new(secrets: Array, template_path: String) click to toggle source
# File lib/lyra/template.rb, line 9
def initialize(secrets: Array, template_path: String)
  @secrets = secrets
  @template_path = template_path
end

Public Instance Methods

generate(output_path: String) click to toggle source
# File lib/lyra/template.rb, line 18
def generate(output_path: String)
  File.open(output_path, 'w+') do |f|
    f.write(render)
    f.close
  end
end
render() click to toggle source
# File lib/lyra/template.rb, line 14
def render
  ERB.new(File.read(@template_path), trim_mode: '<>').result(binding)
end