aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware
diff options
context:
space:
mode:
authorJosé Valim and Mikel Lindsaar <raasdnil@gmail.com>2010-01-22 13:37:29 +1100
committerJosé Valim and Mikel Lindsaar <raasdnil@gmail.com>2010-01-22 13:37:29 +1100
commit8a6a2ca712601a28087f78fb6080b05f526cb0fd (patch)
treede9347d6a398a4317e0c87981e8c75d442e141d7 /actionpack/lib/action_dispatch/middleware
parentc9dc1ac95bc97800dd3deb82fe1cf6f98e27413d (diff)
parent6d30002a52133bd105adb29084f4cc72b1ee847f (diff)
downloadrails-8a6a2ca712601a28087f78fb6080b05f526cb0fd.tar.gz
rails-8a6a2ca712601a28087f78fb6080b05f526cb0fd.tar.bz2
rails-8a6a2ca712601a28087f78fb6080b05f526cb0fd.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r--actionpack/lib/action_dispatch/middleware/notifications.rb32
1 files changed, 0 insertions, 32 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/notifications.rb b/actionpack/lib/action_dispatch/middleware/notifications.rb
deleted file mode 100644
index ce3732b740..0000000000
--- a/actionpack/lib/action_dispatch/middleware/notifications.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-module ActionDispatch
- # Provide notifications in the middleware stack. Notice that for the before_dispatch
- # and after_dispatch notifications, we just send the original env, so we don't pile
- # up large env hashes in the queue. However, in exception cases, the whole env hash
- # is actually useful, so we send it all.
- class Notifications
- def initialize(app)
- @app = app
- end
-
- def call(env)
- request = Request.new(env)
- payload = retrieve_payload_from_env(request.filter_env)
-
- ActiveSupport::Notifications.instrument("action_dispatch.before_dispatch", payload)
-
- ActiveSupport::Notifications.instrument!("action_dispatch.after_dispatch", payload) do
- @app.call(env)
- end
- rescue Exception => exception
- ActiveSupport::Notifications.instrument('action_dispatch.exception',
- :env => env, :exception => exception)
- raise exception
- end
-
- protected
- # Remove any rack related constants from the env, like rack.input.
- def retrieve_payload_from_env(env)
- Hash[:env => env.except(*env.keys.select { |k| k.to_s.index("rack.") == 0 })]
- end
- end
-end