Sha256: 7a6b5e81288c57b280666155185af4694961f5d7676d2f5dc1aba546a0106848

Contents?: true

Size: 1.87 KB

Versions: 9

Compression:

Stored size: 1.87 KB

Contents

= File::Tail for Ruby

== Description

This is a small ruby library that allows it to "tail" files in Ruby, including
following a file, that still is growing like the unix command 'tail -f' can.

== Download

The latest version of <b>File::Tail</b> (file-tail) can be found at

http://www.ping.de/~flori

Online Documentation should be located at

http://flori.github.com/file-tail

== Installation

To install file-tail via its gem type:

# gem install file-tail

To install from the source repository, just type into the command line as root:

# rake install

== Usage

File::Tail is a module in the File class. A lightweight class interface for
logfiles can be seen under File::Tail::Logfile.

Direct extension of File objects with File::Tail works like that:
 File.open(filename) do |log|
   log.extend(File::Tail)
   log.interval = 10
   log.backward(10)
   log.tail { |line| puts line }
 end

It's also possible to mix File::Tail in your own File classes
(see also File::Tail::Logfile):
 class MyFile < File
   include File::Tail
 end
 log = MyFile.new("myfile")
 log.interval = 10
 log.backward(10)
 log.tail { |line| print line }

The forward/backward method returns self, so it's possible to chain
methods together like that:
 log.backward(10).tail { |line| puts line }

A command line utility named rtail, that uses File::Tail is provided as well.

== Documentation

To create the documentation of this module, type

$ rake doc

and the API documentation is generated.

In the examples direcotry is a small example of tail and
pager program that use this module. You also may want look
at the end of file/tail.rb for a little example.

== Author

Florian Frank mailto:flori@ping.de

== License

This is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License Version 2 as published by
the Free Software Foundation: http://www.gnu.org/copyleft/gpl.html

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
file-tail-1.1.1 README.rdoc
file-tail-1.1.0 README.rdoc
file-tail-1.0.12 README.rdoc
file-tail-1.0.11 README.rdoc
file-tail-1.0.10 README.rdoc
file-tail-1.0.9 README.rdoc
file-tail-1.0.8 README.rdoc
file-tail-1.0.7 README.rdoc
file-tail-1.0.6 README.rdoc