lib/cocaine/command_line/runners/backticks_runner.rb in cocaine-0.4.2 vs lib/cocaine/command_line/runners/backticks_runner.rb in cocaine-0.5.0
- old
+ new
@@ -1,5 +1,9 @@
+# coding: UTF-8
+
+require 'climate_control'
+
module Cocaine
class CommandLine
class BackticksRunner
def call(command, env = {})
@@ -8,17 +12,11 @@
end
end
private
- def with_modified_environment(env)
- begin
- saved_env = ENV.to_hash
- ENV.update(env)
- yield
- ensure
- ENV.update(saved_env)
- end
+ def with_modified_environment(env, &block)
+ ClimateControl.modify(env, &block)
end
end
end
end