Sha256: d828ad4b04e9836e0086d9a6e3404df9ac5e512a3461930bde3f135bd0cb08f5

Contents?: true

Size: 791 Bytes

Versions: 3

Compression:

Stored size: 791 Bytes

Contents

class Monologue::Admin::CacheController < Monologue::Admin::BaseController
  before_filter :prepare_file_list

  def show
    if ActionController::Base.perform_caching && Monologue::PageCache.enabled && Monologue::PageCache.wipe_enabled &&  ActionController::Base.page_cache_directory != Rails.public_path
      render :show
    else
      render :how_to_enable
    end
  end

  def destroy
    Monologue::TotalSweeper.wipe_all
    flash.notice = I18n.t("monologue.admin.cache.show.cache_wiped")
    render :show
  end

  private
  def prepare_file_list
    @files = []
    Dir.glob("#{ActionController::Base.page_cache_directory}/**/*").each do |file|
      next if File.directory?(file)
      @files << file.gsub(ActionController::Base.page_cache_directory,"")
    end
    @files
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
monologue-0.3.0 app/controllers/monologue/admin/cache_controller.rb
monologue-0.2.0 app/controllers/monologue/admin/cache_controller.rb
monologue-0.2.0.beta3 app/controllers/monologue/admin/cache_controller.rb