From: Leonardo Mosquera Date: Mon, 13 Feb 2023 23:19:47 +0000 (-0300) Subject: Correct parameter naming for PTY.spawn (#678) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1d5c31719aedb0425d590de6ca0900cf2b09c9c7;p=discourse_docker.git Correct parameter naming for PTY.spawn (#678) Per the docs, first parameter for the block is STDOUT + STDERR, 2nd one is STDIN: https://ruby-doc.org/3.1.3/exts/pty/PTY.html#method-c-spawn As it is now, the method looks like it's reading from STDIN, though in fact it's reading from an incorrectly named parameter for STDOUT. --- diff --git a/image/auto_build.rb b/image/auto_build.rb index d2f830c..b507ec6 100644 --- a/image/auto_build.rb +++ b/image/auto_build.rb @@ -12,9 +12,9 @@ images = { def run(command) lines = [] - PTY.spawn(command) do |stdin, stdout, pid| + PTY.spawn(command) do |stdout, stdin, pid| begin - stdin.each do |line| + stdout.each do |line| lines << line puts line end