Method: Baps::Command#execute
- Defined in:
- lib/baps/command.rb
#execute ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/baps/command.rb', line 31 def execute puts "Executing: #{command}" Open3.popen3(command) do |_stdin, stdout, stderr, wait_thr| stdout_thread = Thread.new do while (line = stdout.gets) do on_stdout(line) end end stderr_thread = Thread.new do while (line = stderr.gets) do on_stderr(line) end end stdout_thread.join stderr_thread.join self.exit_status = wait_thr.value.to_i end end |