Permalink
Browse files

Support for memcached usage via Dalli

  • Loading branch information...
mperham authored and lukemelia committed Sep 3, 2010
1 parent 87014e0 commit beebdcad8de60b3fad309477a6f5a1b446b419bd
Showing with 17 additions and 0 deletions.
  1. +1 −0 lib/rack/bug/panels/cache_panel.rb
  2. +16 −0 lib/rack/bug/panels/cache_panel/dalli_extension.rb
@@ -1,4 +1,5 @@
require "rack/bug/panels/cache_panel/memcache_extension"
+require "rack/bug/panels/cache_panel/dalli_extension"
module Rack
class Bug
@@ -0,0 +1,16 @@
+begin
+
+ require 'dalli'
+
+ Dalli::Client.class_eval do
+ def perform_with_rack_bug(op, *args)
+ Rack::Bug::CachePanel.record(op, args.first) do
+ perform_without_rack_bug(op, *args)
+ end
+ end
+
+ alias_method_chain :perform, :rack_bug
+ end
+
+rescue NameError, LoadError
+end

0 comments on commit beebdca

Please sign in to comment.