lib/cocaine/command_line/runners/posix_runner.rb in cocaine-0.5.4 vs lib/cocaine/command_line/runners/posix_runner.rb in cocaine-0.5.5
- old
+ new
@@ -9,44 +9,38 @@
rescue LoadError
false
end
def self.supported?
- available? && !Cocaine::CommandLine.java?
+ available? && !OS.java?
end
def supported?
self.class.supported?
end
def call(command, env = {}, options = {})
input, output = IO.pipe
options[:out] = output
- with_modified_environment(env) do
- pid = spawn(env, command, options)
- output.close
- result = ""
- while partial_result = input.read(8192)
- result << partial_result
- end
- waitpid(pid)
- input.close
- result
+ pid = spawn(env, command, options)
+ output.close
+ result = ""
+ while partial_result = input.read(8192)
+ result << partial_result
end
+ waitpid(pid)
+ input.close
+ result
end
private
def spawn(*args)
POSIX::Spawn.spawn(*args)
end
def waitpid(pid)
Process.waitpid(pid)
- end
-
- def with_modified_environment(env, &block)
- ClimateControl.modify(env, &block)
end
end
end
end