From 6e0f3fa8bfb29b76cee4ef32f687cbdd8cc9e02d Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 29 Jan 2009 12:51:08 -0800 Subject: [PATCH] Clearer init.rb --- init.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/init.rb b/init.rb index 11898e6..5254a09 100644 --- a/init.rb +++ b/init.rb @@ -1,9 +1,11 @@ -class ActionController::Base - begin - require 'action_profiler' - include ActionProfiler +begin + require 'action_profiler' + class ActionController::Base + include ActionController::ActionProfiler logger.info "Action profiling enabled. Add around_filter :action_profiler to ApplicationController then append ?profile=process_time to any URL to profile the page load and download a calltree file. Open it with kcachegrind." - rescue LoadError + end +rescue LoadError + class ActionController::Base def action_profiler(*args) logger.info "`gem install ruby-prof` to enable action profiling." yield