Sha256: f43f540cd211dd29298f0f5b8a33c3088135ea049f0c5815bce21033154f72f4

Contents?: true

Size: 1.07 KB

Versions: 34

Compression:

Stored size: 1.07 KB

Contents

module Rack::Insight
  class CachePanel

    class PanelApp < ::Rack::Insight::PanelApp

      def dispatch
        case request.path_info
        when "/__insight__/view_cache"         then view_cache
        when "/__insight__/delete_cache"       then delete_cache
        when "/__insight__/delete_cache_list"  then delete_cache_list
        else not_found
        end
      end

      def ok
        Rack::Response.new(["OK"]).to_a
      end

      def view_cache
        validate_params
        render_template "panels/view_cache", :key => params["key"], :value => Rails.cache.read(params["key"])
      end

      def delete_cache
        validate_params
        raise "Rails not found... can't delete key" unless defined?(Rails)
        Rails.cache.delete(params["key"])
        ok
      end

      def delete_cache_list
        validate_params
        raise "Rails not found... can't delete key" unless defined?(Rails)

        params.each do |key, value|
          next unless key =~ /^keys_/
            Rails.cache.delete(value)
        end

        ok
      end

    end

  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
rack-insight-0.6.4 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.6.3 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.6.2 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.30 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.29 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.28 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.27 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.26 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.25 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.24 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.23 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.22 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.21 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.20 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.19 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.18 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.17 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.16 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.15 lib/rack/insight/panels/cache_panel/panel_app.rb
rack-insight-0.5.14 lib/rack/insight/panels/cache_panel/panel_app.rb