Travis build status:
A read only file class, providing random line based access to a large file without loading the whole file into memory.
ARGH. It seems I can’t embed a gist in my README, even though said gist and said README are on github.
So, until I can, the synopsis is over here.
rfile = RFile.new('path/to/file', true, "\n")
path: the path to an existing file
recycle: boolean value, if true the randomline method will reload the index (fast) when it runs out of unique lines to produce
sep_string: the string that determines what a line is, lines returned by the methods do not include the separator
a random line from the file (or nil if no lines are left and recycle == false)
an array of random lines with num elements
the specific line at line_number
Christopher Maujean <[email protected]>