Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtom committed Nov 11, 2012
1 parent 9532e46 commit 3ac0fde
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
6 changes: 4 additions & 2 deletions autoload/tlib/cache.vim
Expand Up @@ -4,7 +4,7 @@
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-06-30.
" @Last Change: 2012-05-11.
" @Revision: 0.1.209
" @Revision: 0.1.210


" |tlib#cache#Purge()|: Remove cache files older than N days.
Expand Down Expand Up @@ -103,7 +103,9 @@ function! tlib#cache#Get(cfile) "{{{3
endf


function! tlib#cache#Value(cfile, generator, ftime, ...)
" Get a cached value from cfile. If it is outdated (compared to ftime)
" or does not exist, create it calling a generator function.
function! tlib#cache#Value(cfile, generator, ftime, ...) "{{{3
if !filereadable(a:cfile) || (a:ftime != 0 && getftime(a:cfile) < a:ftime)
let args = a:0 >= 1 ? a:1 : []
let val = call(a:generator, args)
Expand Down
22 changes: 17 additions & 5 deletions doc/tlib.txt
Expand Up @@ -68,6 +68,7 @@ Contents~
tlib#persistent#Dir ..................... |tlib#persistent#Dir()|
tlib#persistent#Filename ................ |tlib#persistent#Filename()|
tlib#persistent#Get ..................... |tlib#persistent#Get()|
tlib#persistent#Value ................... |tlib#persistent#Value()|
tlib#persistent#Save .................... |tlib#persistent#Save()|
g:tlib#vim#simalt_maximize .............. |g:tlib#vim#simalt_maximize|
g:tlib#vim#simalt_restore ............... |g:tlib#vim#simalt_restore|
Expand Down Expand Up @@ -118,12 +119,13 @@ Contents~
g:tlib#cache#purge_every_days ........... |g:tlib#cache#purge_every_days|
g:tlib#cache#script_encoding ............ |g:tlib#cache#script_encoding|
g:tlib#cache#run_script ................. |g:tlib#cache#run_script|
g:tlib#cache#silent ..................... |g:tlib#cache#silent|
g:tlib#cache#verbosity .................. |g:tlib#cache#verbosity|
g:tlib#cache#dont_purge ................. |g:tlib#cache#dont_purge|
tlib#cache#Dir .......................... |tlib#cache#Dir()|
tlib#cache#Filename ..................... |tlib#cache#Filename()|
tlib#cache#Save ......................... |tlib#cache#Save()|
tlib#cache#Get .......................... |tlib#cache#Get()|
tlib#cache#Value ........................ |tlib#cache#Value()|
tlib#cache#MaybePurge ................... |tlib#cache#MaybePurge()|
tlib#cache#Purge ........................ |tlib#cache#Purge()|
tlib#cache#ListFilesInCache ............. |tlib#cache#ListFilesInCache()|
Expand Down Expand Up @@ -581,6 +583,9 @@ tlib#persistent#Filename(type, ?file=%, ?mkdir=0)
*tlib#persistent#Get()*
tlib#persistent#Get(cfile)

*tlib#persistent#Value()*
tlib#persistent#Value(...)

*tlib#persistent#Save()*
tlib#persistent#Save(cfile, dictionary)

Expand Down Expand Up @@ -905,10 +910,12 @@ g:tlib#cache#run_script (default: 1)
1 ... Query user
2 ... Yes

*g:tlib#cache#silent*
g:tlib#cache#silent (default: 0)
If non-nil, don't display a message that files were deleted from the
cache.
*g:tlib#cache#verbosity*
g:tlib#cache#verbosity (default: 1)
Verbosity level:
0 ... Be quiet
1 ... Display informative message
2 ... Display detailed messages

*g:tlib#cache#dont_purge*
g:tlib#cache#dont_purge (default: ['[\/]\.last_purge$'])
Expand All @@ -929,6 +936,11 @@ tlib#cache#Save(cfile, dictionary)
*tlib#cache#Get()*
tlib#cache#Get(cfile)

*tlib#cache#Value()*
tlib#cache#Value(cfile, generator, ftime, ...)
Get a cached value from cfile. If it is outdated (compared to ftime)
or does not exist, create it calling a generator function.

*tlib#cache#MaybePurge()*
tlib#cache#MaybePurge()
Call |tlib#cache#Purge()| if the last purge was done before
Expand Down

0 comments on commit 3ac0fde

Please sign in to comment.