Class: ProcfileUpstartExporter::ProcessJobRenderer
- Inherits:
-
Object
- Object
- ProcfileUpstartExporter::ProcessJobRenderer
- Defined in:
- lib/procfile_upstart_exporter/process_job_renderer.rb
Instance Attribute Summary collapse
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(template = File.read( File.expand_path( File.join('..', '..', '..', 'templates', 'process.conf.erb'), __FILE__ ) )) ⇒ ProcessJobRenderer
constructor
A new instance of ProcessJobRenderer.
- #render(application, user, environment_variables, application_root, log, process) ⇒ Object
Constructor Details
#initialize(template = File.read( File.expand_path( File.join('..', '..', '..', 'templates', 'process.conf.erb'), __FILE__ ) )) ⇒ ProcessJobRenderer
Returns a new instance of ProcessJobRenderer.
4 5 6 7 8 9 10 11 12 |
# File 'lib/procfile_upstart_exporter/process_job_renderer.rb', line 4 def initialize( template = File.read( File.( File.join('..', '..', '..', 'templates', 'process.conf.erb'), __FILE__ ) ) ) @erb = ERB.new template, nil, '-' end |
Instance Attribute Details
#template ⇒ Object (readonly)
Returns the value of attribute template.
2 3 4 |
# File 'lib/procfile_upstart_exporter/process_job_renderer.rb', line 2 def template @template end |
Instance Method Details
#render(application, user, environment_variables, application_root, log, process) ⇒ Object
14 15 16 17 18 19 20 |
# 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 |