Sha256: e937b39d294a39758feffa8177d0423ee31d53f16458b547ca4e8def8b89be09

Contents?: true

Size: 668 Bytes

Versions: 47

Compression:

Stored size: 668 Bytes

Contents

module Cms
  module Caching
    def caching_enabled?
      ActionController::Base.perform_caching
    end
    def flush_cache
      #Hmmm...this is kinda scary.  What if page cache directory is
      #set to the the default, which is /public?
      #So we are going to check that the directory is not called "public"
      if File.exists?(ActionController::Base.page_cache_directory) && 
          File.basename(ActionController::Base.page_cache_directory) != "public"
        FileUtils.rm_rf Dir.glob("#{ActionController::Base.page_cache_directory}/*")
        Rails.logger.info "Cache Flushed"
      end
    end   
  end
  class << self
    include Caching
  end
end

Version data entries

47 entries across 47 versions & 11 rubygems

Version Path
SFEley-browsercms-3.0.2 lib/cms/caching.rb
buzzware-browsercms-3.0.2 lib/cms/caching.rb
coredumplings-browsercms-3.0.0 lib/cms/caching.rb
nate-browsercms-3.0.210 lib/cms/caching.rb
nate-browsercms-3.0.211 lib/cms/caching.rb
we5-browsercms-3.0.1.1 lib/cms/caching.rb
webficient-browsercms-3.0.1 lib/cms/caching.rb
webficient-browsercms-3.0.2 lib/cms/caching.rb
webficient-browsercms-3.0.3 lib/cms/caching.rb
webficient-browsercms-3.0.4 lib/cms/caching.rb
browsercms-3.4.2 lib/cms/caching.rb
browsercms-3.3.4 lib/cms/caching.rb
browsercms-3.4.2.rc1 lib/cms/caching.rb
browsercms-3.4.1 lib/cms/caching.rb
browsercms-3.4.0 lib/cms/caching.rb
browsercms-3.4.0.rc2 lib/cms/caching.rb
browsercms-3.4.0.rc1 lib/cms/caching.rb
browsercms-3.3.3 lib/cms/caching.rb
browsercms-3.1.5 lib/cms/caching.rb
browsercms-3.1.4 lib/cms/caching.rb