Class: Linchpin::Templater

Inherits:
Object
  • Object
show all
Includes:
ERB::Util
Defined in:
lib/linchpin/templater.rb

Instance Method Summary collapse

Constructor Details

#initialize(entry_project) ⇒ Templater

Returns a new instance of Templater.



8
9
10
11
# File 'lib/linchpin/templater.rb', line 8

def initialize(entry_project)
  @entry_project = entry_project
  @template_loc = File.join(File.join(File.dirname(File.expand_path(__FILE__)), 'dockerfiles'),'dotnet-Dockerfile.erb')
end

Instance Method Details

#renderObject



13
14
15
16
# File 'lib/linchpin/templater.rb', line 13

def render
  template = ERB.new File.new(@template_loc).read, nil, '%'
  template.result(binding)
end