Sha256: 978181401a0499dba1c95eb70b0e3d5549468bc682151d69e8a4af7df4c12eb1
Contents?: true
Size: 561 Bytes
Versions: 7
Compression:
Stored size: 561 Bytes
Contents
# Aruba module Aruba # Platforms module Platforms # Local environemnt # # Wraps logic to make enviroment local and restorable class LocalEnvironment # Run in environment # # @param [Hash] env # The environment # # @yield # The block of code which should with local ENV def call(env, &block) old_env = ENV.to_hash.dup ENV.clear ENV.update env block.call if block_given? ensure ENV.clear ENV.update old_env end end end end
Version data entries
7 entries across 7 versions & 1 rubygems