#!/usr/bin/env ruby
#
# cat-slowly - prints each line of input on STDIN slowly, after a small delay

$stdout.sync = true # don't buffer the output stream; always flush
delay = (ENV['DELAY'] || 0.03).to_f
ARGV.each do |f|
  IO.foreach(f) do |l|
    puts l
    sleep delay
  end
end
