Method: PSWindows::Exec#delete_env_var
- Defined in:
- lib/beaker/host/pswindows/exec.rb
#delete_env_var(key, val) ⇒ Object
Delete the provided key/val from the current ssh environment
135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/beaker/host/pswindows/exec.rb', line 135 def delete_env_var key, val key = key.to_s.upcase # get the current value of the key cur_val = get_env_var(key, true) subbed_val = (cur_val.split(';') - [val.gsub(/'|"/, '')]).join(';') return unless subbed_val != cur_val # remove the current key value self.clear_env_var(key) # set to the truncated value self.add_env_var(key, subbed_val) end |