class ProcfileUpstartExporter::ProcessJobRenderer

Attributes

template[R]

Public Class Methods

new( template = File.read( File.expand_path( File.join('..', '..', '..', 'templates', 'process.conf.erb'), __FILE__ ) ) ) click to toggle source
# File lib/procfile_upstart_exporter/process_job_renderer.rb, line 4
def initialize(
  template = File.read(
    File.expand_path(
      File.join('..', '..', '..', 'templates', 'process.conf.erb'), __FILE__
    )
  )
)
  @erb = ERB.new template, nil, '-'
end

Public Instance Methods

render(application, user, environment_variables, application_root, log, process) click to toggle source
# File lib/procfile_upstart_exporter/process_job_renderer.rb, line 14
def render application, user, environment_variables, application_root,
           log, process
  ProcfileUpstartExporter.logger.debug 'Start rendering process job'
  # Double assign to avoid warnings
  home = home = Etc.getpwnam(user).dir
  @erb.result binding
end