Sha256: 890726154cd4e7244edbd09ec36acd1c6f66d342c07bca052dd49d1418b50a01
Contents?: true
Size: 255 Bytes
Versions: 9
Compression:
Stored size: 255 Bytes
Contents
def set_env(*args, &_block) hash = args.first.is_a?(Hash) ? args.first : Hash[*args] old_values = Hash[hash.map { |k, _| [k, ENV[k]] }] begin hash.each { |k, v| ENV[k] = v } yield ensure old_values.each { |k, v| ENV[k] = v } end end
Version data entries
9 entries across 9 versions & 1 rubygems