Method: Foreman::Process#expanded_command

Defined in:
lib/foreman/process.rb

#expanded_command(custom_env = {}) ⇒ String

Get environment-expanded command for a Process

Parameters:

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

    ({}) Environment variables to merge with defaults

Returns:

  • (String)

    The expanded command



30
31
32
33
34
35
36
37
# File 'lib/foreman/process.rb', line 30

def expanded_command(custom_env={})
  env = @options[:env].merge(custom_env)
  expanded_command = command.dup
  env.each do |key, val|
    expanded_command.gsub!("$#{key}", val)
  end
  expanded_command
end