Skip to content

Commit

Permalink
Request profiler: use actual script path and line numbers for backtra…
Browse files Browse the repository at this point in the history
…ces.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Dec 22, 2007
1 parent a81333f commit a7027a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions actionpack/lib/action_controller/request_profiler.rb
Expand Up @@ -13,7 +13,7 @@ def self.benchmark(n, script)

def initialize(script_path)
@quiet = false
define_run_method(File.read(script_path))
define_run_method(script_path)
reset!
end

Expand All @@ -38,8 +38,9 @@ def say(message)
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

Expand Down

0 comments on commit a7027a9

Please sign in to comment.