From d2e0761c4f666c16ed16dff4beb5fcfcda94b1ea Mon Sep 17 00:00:00 2001 From: Aaron Wheeler Date: Sat, 12 Apr 2008 11:39:50 +0900 Subject: [PATCH] Added minor documentation and logging for clarity on which files are expired by the page cacher --- merb-cache/lib/merb-cache/cache-page.rb | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/merb-cache/lib/merb-cache/cache-page.rb b/merb-cache/lib/merb-cache/cache-page.rb index e2e5c8e..4c26d58 100644 --- a/merb-cache/lib/merb-cache/cache-page.rb +++ b/merb-cache/lib/merb-cache/cache-page.rb @@ -64,8 +64,14 @@ module Merb::Cache::ControllerInstanceMethods # ==== Parameter # options:: The options that will be passed to #expire_key_for # - # ==== Examples + # ==== Examples (See Merb::Cache#expire_key_for for more options) + # # will expire path/to/page/cache/news/show/1.html + # expire_page(:key => url(:news,News.find(1))) + # + # # will expire path/to/page/cache/news/show.html # expire_page(:action => 'show', :controller => 'news') + # + # # will expire path/to/page/cache/news/show* # expire_page(:action => 'show', :match => true) def expire_page(options) config_dir = Merb::Controller._cache.config[:cache_html_directory] @@ -75,6 +81,7 @@ module Merb::Cache::ControllerInstanceMethods else files = config_dir / "#{key}.html" end + Merb.logger.info("cache: expiring pages matching #{files}") FileUtils.rm_rf(files) end true -- 1.5.3.1