A Library for handling cookie jar files as known from 'fortune'.
The latest development version can be found at GitHub:
The latest stable version can be installed from Gemcutter:
gem install rfortune
To instantiate RFortune you have to give the relative path to a cookie jar file as an argument. If there is no argument given or no such file a new one will be created. File paths can be specified relative or absolute or as the name of a file from beneath /usr/share/games/forunes.
cookies = RFortune.new 'cookie_jar_file'
To get a random cookie from the specified file:
To get a random cookie from any of the available Cookie Jar files from beneath /usr/share/games/fortunes:
To include offensive fortunes:
RFortune.random_fortune( :offensive => true )
Copyright © 2009 Helge Rausch. See LICENSE for details.