Method: Foreman::Process#exec

Defined in:
lib/foreman/process.rb

#exec(options = {}) ⇒ Object

Exec a Process

Parameters:

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

Options Hash (options):

  • :env (Object) — default: {}

    Environment variables to set for this execution

Returns:

  • Does not return



65
66
67
68
69
70
# File 'lib/foreman/process.rb', line 65

def exec(options={})
  env = @options[:env].merge(options[:env] || {})
  env.each { |k, v| ENV[k] = v }
  Dir.chdir(cwd)
  Kernel.exec expanded_command(env)
end