RubyGems Navigation menu

itrigga-file_cache 0.2.1

A simple file-system-based cache wrapper. The main method is 'with_cache( :cache_key=>'something_unique', :timeout_seconds=>(an integer) ){ (...) }' If the given cache key exists and has not timed out, it will return the cached value If not, it will * yield to the given block * store the result of the given block in the cache with the given key * return the result of the given block Required params: * :cache_key=>'some unique string that is valid in a filename' Optional params: * :timeout_seconds => (an integer - default 3600) * :cache_dir => (an absolute path - defaults to RAILS_ROOT/tmp/cache if RAILS_ROOT is defined, otherwise /tmp/cache ) Example usage: @stats_json = Itrigga::Cache::FileCache.with_cache(:cache_key=>'admin_stats.json', :timeout_seconds=>600){ /* some expensive remote API / slow IO call here /* }

Gemfile:
= 复制到剪贴板 已复制!

安装:
=

版本列表:

  1. 0.2.1 - October 03, 2011 (8.5 KB)
  2. 0.2.0 - October 03, 2011 (8.5 KB)
  3. 0.1.0 - October 03, 2011 (8.5 KB)

Development 依赖 (4):

bundler ~> 1.0.0
jeweler ~> 1.6.4
rcov >= 0
rspec >= 0

业主:

作者:

  • Al Davidson

SHA 256 校验和:

b0ad083ccc8e56053b83ce8769a1c297cdefe3bde700b90ceeea13b674d622df

下载总量 10,894

这个版本 4,321

许可:

需要的 Ruby 版本:

链接: