Sha256: 8c688688e9dda00f24287e78e330e12966007a39b96ccf25e13f11f61d3b8931
Contents?: true
Size: 633 Bytes
Versions: 28
Compression:
Stored size: 633 Bytes
Contents
module FeduxOrg module Stdlib module Environment # Set environment variable for code block # # @param [Hash] variables # the variables which should be set for that environment # # @yield # the block which should be run which the change environment def isolated_environment(variables, &block) #backup old_env = ENV.to_hash #change env ENV.update variables block_result = block.call #cleanup ENV.clear #install backuped information ENV.update old_env block_result end end end end
Version data entries
28 entries across 28 versions & 1 rubygems