Class: Aruba::Platforms::LocalEnvironment
- Inherits:
-
Object
- Object
- Aruba::Platforms::LocalEnvironment
- Defined in:
- lib/aruba/platforms/local_environment.rb
Overview
Local environemnt
Wraps logic to make enviroment local and restorable
Instance Method Summary collapse
-
#call(env) { ... } ⇒ Object
Run in environment.
Instance Method Details
#call(env) { ... } ⇒ Object
Run in environment
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/aruba/platforms/local_environment.rb', line 16 def call(env, &block) old_env = ENV.to_hash.dup ENV.clear ENV.update env yield if block_given? ensure ENV.clear ENV.update old_env end |