Giter Site home page Giter Site logo

file-tail's Introduction

== 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

or

# ruby install.rb

== 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 }

== Documentation

To create the documentation of this module, type

$ rake doc

or

$ ruby make_doc.rb

and the API documentation is generated by your rdoc command.

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:[email protected]

== 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

file-tail's People

Contributors

flori avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.