Class: Indocker::Images::TemplateCompiler
- Inherits:
-
Object
- Object
- Indocker::Images::TemplateCompiler
- Defined in:
- lib/indocker/images/template_compiler.rb
Instance Method Summary collapse
Instance Method Details
#compile(path, context) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/indocker/images/template_compiler.rb', line 4 def compile(path, context) Indocker.logger.debug("compiling template file #{path}".grey) template = File.read(path) content = ERB.new(template).result(context.helper.get_binding) File.write(path, content) rescue Errno::EACCES => e # do nothing for read only files rescue => e Indocker.logger.error("compilation failed for template file #{path}. #{e.inspect}") raise e end |