lib/scout/misc/system.rb in scout-gear-7.3.0 vs lib/scout/misc/system.rb in scout-gear-8.0.0

- old
+ new

@@ -10,6 +10,16 @@ else ENV[var] += sep + value end end end + + def self.with_env(var, value, &block) + old_value = ENV[var] + begin + ENV[var] = value + yield + ensure + ENV[var] = old_value + end + end end