Permalink
Browse files

updating readme, removing unnecessary requirement, adding uninstall.rb

  • Loading branch information...
yeah committed Sep 15, 2009
1 parent 8274208 commit 259676eaa0762edc7082296c3e39cd4eaa2154b0
Showing with 24 additions and 3 deletions.
  1. +4 −1 README.rdoc
  2. +0 −1 install.rb
  3. +20 −1 uninstall.rb
View
@@ -9,7 +9,10 @@ PageCacheFu adds the following missing features:
== Installation
* Just install the plugin, add something like <code>:expires_in => 30.minutes</code> to your <code>caches_page</code> calls.
-* Set up a cronjob to periodically run the <code>page_cache_fu:sweep_expired_page_caches</code> Rake task.
+* Set up a cronjob to periodically run the <code>page_cache_sweeper</code> script using something like this in your <code>crontab</code>:
+
+ * * * * * www-data /usr/bin/ruby /path/to/my/rails_app/script/page_cache_sweeper
+
* Tell your Apache to use the new cache location using something like this in your <code>Virtualhost</code> config:
RewriteMap uri_escape int:escape
View
@@ -1,5 +1,4 @@
require 'ftools'
-require 'erb'
# Install page_cache_sweeper into the local script directory.
#
View
@@ -1 +1,20 @@
-# Uninstall hook code here
+require 'ftools'
+
+# Remove page_cache_sweeper from the local script directory.
+#
+# If page_cache_sweeper doesn't exists, print a warning and exit.
+#
+if File.directory? "script"
+ dest_dir = "script"
+end
+
+dest_sweeper_file = File.join(dest_dir, "page_cache_sweeper") if dest_dir
+
+if !dest_dir
+ STDERR.puts "Could not find a script directory. Please remove the page_cache_sweeper script manually."
+elsif !File::exists? dest_sweeper_file
+ STDERR.puts "No page_cache_sweeper found. Please remove the page_cache_sweeper script manually if it's still installed."
+else
+ File.delete dest_sweeper_file
+ puts "Uninstallation successful. The page_cache_sweeper script has been removed from the script directory."
+end

0 comments on commit 259676e

Please sign in to comment.