Method: Scmd::Command#start

Defined in:
lib/scmd/command.rb

#start(input = nil) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/scmd/command.rb', line 54

def start(input = nil)
  setup_run

  @pid = @child_process.pid.to_i
  @child_process.write(input)
  @read_output_thread =
    Thread.new do
      while @child_process.check_for_exit
        begin
          read_output
        rescue EOFError # rubocop:disable Lint/SuppressedException
        end
      end
      @stop_w.write_nonblock(".")
    end
end