Sha256: aa5d6f1f1c230badb2d116879d1b4e7fd9dbf73cfa1fb444da329dfa2f4a2078
Contents?: true
Size: 474 Bytes
Versions: 10
Compression:
Stored size: 474 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
10 entries across 10 versions & 1 rubygems