File: output.rb

package info (click to toggle)
ruby-tty-command 0.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 452 kB
  • sloc: ruby: 1,990; makefile: 4; sh: 4
file content (10 lines) | stat: -rw-r--r-- 242 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

require_relative "../lib/tty-command"

cmd = TTY::Command.new
cmd.run("i=0; while true; do i=$[$i+1]; echo 'hello '$i; sleep 1; done") do |out, err|
  if out =~ /.*5.*/
    raise ArgumentError, "BOOM"
  end
end