Browse files

improve doc

  • Loading branch information...
phoet committed Sep 6, 2009
1 parent 5dcffaf commit 504268ec7304c02c465e8635b48d6f2e6e788a78
Showing with 11 additions and 4 deletions.
  1. +11 −4 README.rdoc
@@ -6,16 +6,23 @@ Simple caching utility that persists arbitrary data in files.
$ gem install phoet-file_cache -s
-== Dependencies
== How to use
Just include the FileCache module and use the provided +file_cache+ method
+ include FileCache
+ [...]
file_cache :the_name_of_the_action_you_execute do
#some stuff that should be cached, an external API call f.e.
The block you are providing is only executed if there is no cache-data provided or if the cache is expired.
+By default, the cache expires after half an hour, but you can override this behavior by passing in time you want the content to be cached as a second argument.
+ file_cache :the_name_of_the_action_you_execute, 60 do ...
+FileCache persists the return-value of the given block in a file in your local _tmp-folder_.
+You may override this behavior by setting the +file_cache_dir+.
+ self.file_cache_dir='path_to_other_dir'

0 comments on commit 504268e

Please sign in to comment.