Sha256: 46ff8d29adf9079fb8ddea9c9b5ec8179bf08f46d1c79e5c7d8e999f2cfd1208
Contents?: true
Size: 544 Bytes
Versions: 2
Compression:
Stored size: 544 Bytes
Contents
# $ ruby demos/ping_monitor.rb # 0.077 xxxxxxxxxxxxxxxxxxxxxxx # 0.021 xxxxxx # 0.027 xxxxxxxx # 0.021 xxxxxx # 0.021 xxxxxx # 0.041 xxxxxxxxxxxx # 0.021 xxxxxx # 0.023 xxxxxx # ^C require "./lib/kommando" k = Kommando.new "ping -i 0.2 127.0.0.1" k.out.every /time=(\d+\.\d+)\s/ do |m| time = m[1].to_f print "#{time} ".ljust(6) puts "x" * (time*300.to_i) end k.out.once(/^PING.+\n$/).every(/^(.+)\r\n/) do |m| unless m[1].start_with? "64 bytes from" puts "ERR: unexpected reply: #{m[1]}" exit 1 end end k.run
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kommando-0.1.2 | demos/ping_monitor.rb |
kommando-0.1.1 | demos/ping_monitor.rb |