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