diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-22 02:15:44 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-22 02:15:44 +0000 |
commit | a7027a94d461167e4d206457447afa73c16a7156 (patch) | |
tree | 8d557477fe9393260a1f9a48acb5de03d443b788 /actionpack | |
parent | a81333f115c877fc59601f4e0766df4bdce4a8d8 (diff) | |
download | rails-a7027a94d461167e4d206457447afa73c16a7156.tar.gz rails-a7027a94d461167e4d206457447afa73c16a7156.tar.bz2 rails-a7027a94d461167e4d206457447afa73c16a7156.zip |
Request profiler: use actual script path and line numbers for backtraces.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rwxr-xr-x | actionpack/lib/action_controller/request_profiler.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/request_profiler.rb b/actionpack/lib/action_controller/request_profiler.rb index 62f6e665f1..f33cbf49e8 100755 --- a/actionpack/lib/action_controller/request_profiler.rb +++ b/actionpack/lib/action_controller/request_profiler.rb @@ -13,7 +13,7 @@ module ActionController def initialize(script_path) @quiet = false - define_run_method(File.read(script_path)) + define_run_method(script_path) reset! end @@ -38,8 +38,9 @@ module ActionController end private - def define_run_method(script) - instance_eval "def run; #{script}; end", __FILE__, __LINE__ + def define_run_method(script_path) + script = File.read(script_path) + instance_eval "def run; #{script}; end", script_path, 1 end end |