public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
mephisto / lib / tasks / mephisto.rake
100644 16 lines (15 sloc) 0.755 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
STATS_DIRECTORIES << %w(Liquid\ Drops app/drops) << %w(Liquid\ Filters app/filters) << %w(Observers/Sweeprs app/cachers)
 
namespace :cache do
  desc "Clear page cache for one or more sites. (rake cache:clear ID=1,2 HOST=foo.com)"
  task :clear => :environment do
    require 'application'
    sites = []
    sites += Site.find(ENV['ID'].split(',')) if ENV['ID']
    sites += Site.find(:all, :conditions => ['host IN (?)', ENV['HOST'].split(',')]) if ENV['HOST']
    sites = Site.find(:all) if sites.empty?
    sites.each do |site|
      ApplicationController.page_cache_directory = site.page_cache_directory.to_s
      puts site.expire_cached_pages(ApplicationController, "Clearing page cache for '#{site.title || "site #{site.id}"}'")
    end
  end
end