From f0514ef8253a43dc777741824cfe21132b81beb7 Mon Sep 17 00:00:00 2001 From: Aaron Wheeler Date: Sun, 6 Apr 2008 09:00:40 +0900 Subject: [PATCH] Added minor update to docs for expire_page --- merb-cache/lib/merb-cache/cache-page.rb | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/merb-cache/lib/merb-cache/cache-page.rb b/merb-cache/lib/merb-cache/cache-page.rb index e2e5c8e..9ee32d6 100644 --- a/merb-cache/lib/merb-cache/cache-page.rb +++ b/merb-cache/lib/merb-cache/cache-page.rb @@ -59,14 +59,24 @@ module Merb::Cache::ControllerInstanceMethods File.file?(Merb::Controller._cache.config[:cache_html_directory] / "#{key}.html") end - # Expires the page identified by the key computed after the parameters + # Expires the page identified by the key computed after the parameters. # # ==== Parameter # options:: The options that will be passed to #expire_key_for # + # ==== Options + # key:: specify the key to be used to expire the page cache. Overrides + # the typical key generation. + # match:: specify whether to match the single key or to use Dir.glob to + # expire all matching paths + # + # See +expire_key_for+ for more options. + # # ==== Examples - # expire_page(:action => 'show', :controller => 'news') - # expire_page(:action => 'show', :match => true) + # expire_page(:action => 'show', :controller => 'news') # expires /news/show.html + # expire_page(:action => 'show', :match => true) # expires /news/show/**/* + # expire_page(:key => '/nose/shrew/**/*', :match => true ) # expires /nose/shrew/**/* + # expire_page(:match => '/nose/shrew/**/*' ) # shortcut for the above def expire_page(options) config_dir = Merb::Controller._cache.config[:cache_html_directory] Merb::Controller._cache.expire_key_for(options, controller_name, true) do |key, match| -- 1.5.3.1