Sha256: 6c24bd564e37ebbabe7a31c4deec6d40aaf84931e40a5567e501e5b371b8e302
Contents?: true
Size: 413 Bytes
Versions: 7
Compression:
Stored size: 413 Bytes
Contents
module Puppet::Util::Execution module_function # Run some code with a specific environment. Resets the environment back to # what it was at the end of the code. def withenv(hash) oldvals = {} hash.each do |name, val| name = name.to_s oldvals[name] = ENV[name] ENV[name] = val end yield ensure oldvals.each do |name, val| ENV[name] = val end end end
Version data entries
7 entries across 7 versions & 1 rubygems