Sha256: 7b35fcec2631be3d862286588718ddddeeb0512b70189547e488a781626fa2b0

Contents?: true

Size: 295 Bytes

Versions: 5

Compression:

Stored size: 295 Bytes

Contents

# encoding: utf-8

require 'tty-command'
require 'logger'

logger = Logger.new('dev.log')
cmd = TTY::Command.new

Thread.new do
  10.times do |i|
    sleep 1
    if i == 5
      logger << "error\n"
    else
      logger << "hello #{i}\n"
    end
  end
end


cmd.wait('tail -f dev.log', /error/)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tty-command-0.8.1 examples/wait.rb
tty-command-0.8.0 examples/wait.rb
tty-command-0.7.0 examples/wait.rb
tty-command-0.6.0 examples/wait.rb
tty-command-0.5.0 examples/wait.rb