Sha256: 007af1557cd93390dc2bcd64f620e206b20bb7edd2d95690c6cc81df7089f6ca

Contents?: true

Size: 468 Bytes

Versions: 21

Compression:

Stored size: 468 Bytes

Contents

require 'erb'

class Indocker::Images::TemplateCompiler
  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
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
indocker-0.1.18 lib/indocker/images/template_compiler.rb
indocker-0.3.1 lib/indocker/images/template_compiler.rb
indocker-0.3.0 lib/indocker/images/template_compiler.rb
indocker-0.1.17 lib/indocker/images/template_compiler.rb
indocker-0.1.16 lib/indocker/images/template_compiler.rb
indocker-0.1.15 lib/indocker/images/template_compiler.rb
indocker-0.1.14 lib/indocker/images/template_compiler.rb
indocker-0.1.13 lib/indocker/images/template_compiler.rb
indocker-0.1.12 lib/indocker/images/template_compiler.rb
indocker-0.1.11 lib/indocker/images/template_compiler.rb
indocker-0.1.10 lib/indocker/images/template_compiler.rb
indocker-0.1.9 lib/indocker/images/template_compiler.rb
indocker-0.1.8 lib/indocker/images/template_compiler.rb
indocker-0.1.7 lib/indocker/images/template_compiler.rb
indocker-0.1.6 lib/indocker/images/template_compiler.rb
indocker-0.1.5 lib/indocker/images/template_compiler.rb
indocker-0.1.4 lib/indocker/images/template_compiler.rb
indocker-0.1.3 lib/indocker/images/template_compiler.rb
indocker-0.1.2 lib/indocker/images/template_compiler.rb
indocker-0.1.1 lib/indocker/images/template_compiler.rb