提交 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) ...@@ -13,7 +13,7 @@ def self.benchmark(n, script)
def initialize(script_path) def initialize(script_path)
@quiet = false @quiet = false
define_run_method(File.read(script_path)) define_run_method(script_path)
reset! reset!
end end
...@@ -38,8 +38,9 @@ def say(message) ...@@ -38,8 +38,9 @@ def say(message)
end end
private private
def define_run_method(script) def define_run_method(script_path)
instance_eval "def run; #{script}; end", __FILE__, __LINE__ script = File.read(script_path)
instance_eval "def run; #{script}; end", script_path, 1
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册