Method: Unix::Exec#get_env_var

Defined in:
lib/beaker/host/unix/exec.rb

#get_env_var(key) ⇒ Object

Return the value of a specific env var

Examples:

host.get_env_var('path')

Parameters:

  • key (String)

    The key to look for



242
243
244
245
# File 'lib/beaker/host/unix/exec.rb', line 242

def get_env_var key
  key = key.to_s
  exec(Beaker::Command.new("env | grep ^#{key}="), :accept_all_exit_codes => true).stdout.chomp
end