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
This commit is contained in:
Jeremy Kemper
2007-12-22 02:15:44 +00:00
parent a81333f115
commit a7027a94d4

View File

@@ -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