Sha256: 2d58c83014b2b6ffae83200f86238fa3416d54d6f2554ab54300d3fbbf72902e

Contents?: true

Size: 420 Bytes

Versions: 2

Compression:

Stored size: 420 Bytes

Contents

#!/usr/bin/env ruby
# A poor man's pager... :)

require 'file/tail'

filename = ARGV.shift or fail "Usage: #$0 filename [height]"
height = (ARGV.shift || 24).to_i - 1

File::Tail::Logfile.open(filename, :break_if_eof => true) do |log|
	begin
		log.tail(height) { |line| puts line }
		print "Press return key to continue!" ; gets
		print ""
		redo
	rescue File::Tail::BreakException
	end
end
	# vim: set noet sw=4 ts=4:

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
file-tail-0.1.2 examples/pager.rb
file-tail-0.1.3 examples/pager.rb