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



257
258
259
260
# File 'lib/beaker/host/unix/exec.rb', line 257

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