Sha256: 0f82a865411b9180de13dbcc76adb0056897fdcc727e0438d3115c7ed48fa381
Contents?: true
Size: 938 Bytes
Versions: 56
Compression:
Stored size: 938 Bytes
Contents
# encoding: utf-8 module FeduxOrgStdlib # Enviroment helpers # # @deprecated Please use https://github.com/cucumber/aruba instead module Environment # Set environment variable for code block # # @param [Hash] new_environment_variables # the variables which should be set for that environment # # @param [Hash] options # options for environment manipulation # # @option options [True,False] :clear # Should the environment clear before merge? # # @yield # the block which should be run which the change environment def isolated_environment(new_environment_variables, options = {}, &block) old_environment = ENV.to_hash ENV.clear if options[:clear] == true ENV.update new_environment_variables block.call ensure ENV.clear ENV.update old_environment end alias_method :with_environment, :isolated_environment end end
Version data entries
56 entries across 56 versions & 1 rubygems