2
ruby의 pty 클래스를 사용하여 이와 같은 명령을 실행하면 특정 입력 문자열을 찾으면 어떻게 죽입니까?Ruby에서 PTY.spawn 호출을 어떻게 종료합니까?
cmd = "appcfg.py update cdn"
PTY.spawn("#{cmd} 2>&1") do | input, output, pid |
begin
input.expect("Email:") do
output.write("#{credentials[:username]}\n")
end
input.expect("Password:") do
output.write("#{credentials[:password]}\n")
end
if input.gets == "SOMETHING"
EXIT!
end
rescue Exception => e
puts "GAE Error..."
end
end
올바른 방법은 무엇입니까?