提交 49ec08aa 编写于 作者: N Nicholas Seckar

Added Extension extension to provide support for clean backtraces.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2623 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 3b8fce7b
*SVN*
* Added Extension extension to provide support for clean backtraces. [Nicholas Seckar]
* Updated whiny nil to be more concise and useful. [Nicholas Seckar]
* Added Enumerable#first_match [Nicholas Seckar]
......
class Exception
alias :clean_message :message
TraceSubstitutions = []
def clean_backtrace
backtrace.collect do |line|
TraceSubstitutions.inject(line) do |line, (regexp, sub)|
line.gsub regexp, sub
end
end
end
def application_backtrace
clean_backtrace.reject { |line| line =~ /(vendor|dispatch|ruby|script\/\w+)/ }
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册