lib/hookit/resource/execute.rb in hookit-0.12.1 vs lib/hookit/resource/execute.rb in hookit-0.12.2

- old
+ new

@@ -2,11 +2,11 @@ require 'open3' module Hookit module Resource class Execute < Base - + field :command field :cwd field :environment field :user field :path @@ -81,11 +81,11 @@ until stdout_eof and stderr_eof do (ready_pipes, dummy, dummy) = IO.select([stdout, stderr]) ready_pipes.each_with_index do |socket| if socket == stdout begin - chunk = socket.readpartial(4096) + chunk = socket.readpartial(1) if on_data and on_data.respond_to? :call on_data.call(chunk) end if on_stdout and on_stdout.respond_to? :call on_stdout.call(chunk) @@ -94,11 +94,11 @@ stdout_eof = true end result << chunk.to_s elsif socket == stderr begin - chunk = socket.readpartial(4096) + chunk = socket.readpartial(1) if on_data and on_data.respond_to? :call on_data.call(chunk) end if on_stderr and on_stderr.respond_to? :call on_stderr.call(chunk) @@ -140,11 +140,11 @@ if user com = su(user, com) end - com + com end # strategy: # 1- escape the escapes # 2- escape quotes @@ -180,6 +180,6 @@ raise Hookit::Error::UnexpectedExit, "'#{name}' exited with #{res}, expected #{returns}" unless ignore_exit end end end -end \ No newline at end of file +end