Method: Foreman::Engine#register

Defined in:
lib/foreman/engine.rb

#register(name, command, options = {}) ⇒ Object

Register a process to be run by this Engine

Parameters:

  • name (String)

    A name for this process

  • command (String)

    The command to run

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :env (Hash)

    A custom environment for this process



148
149
150
151
152
153
154
# File 'lib/foreman/engine.rb', line 148

def register(name, command, options={})
  options[:env] ||= env
  options[:cwd] ||= File.dirname(command.split(" ").first)
  process = Foreman::Process.new(command, options)
  @names[process] = name
  @processes << process
end