Module: StackMaster::SparkleFormation::Template

Defined in:
lib/stack_master/sparkle_formation/template_file.rb

Class Method Summary collapse

Class Method Details

.render(prefix, file_name, vars) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/stack_master/sparkle_formation/template_file.rb', line 40

def self.render(prefix, file_name, vars)
  file_path = File.join(::SparkleFormation.sparkle_path, prefix, file_name)
  template_context = TemplateContext.build(vars, prefix)
  CloudFormationInterpolatingEruby.evaluate_file(file_path, template_context)
rescue Errno::ENOENT
  Kernel.raise TemplateFileNotFound, "Could not find template file at path: #{file_path}"
end