提交 a7027a94 编写于 作者: J Jeremy Kemper

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
上级 a81333f1
......@@ -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
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册