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
This commit is contained in:
parent
3b8fce7b52
commit
49ec08aaa7
|
@ -1,5 +1,7 @@
|
||||||
*SVN*
|
*SVN*
|
||||||
|
|
||||||
|
* Added Extension extension to provide support for clean backtraces. [Nicholas Seckar]
|
||||||
|
|
||||||
* Updated whiny nil to be more concise and useful. [Nicholas Seckar]
|
* Updated whiny nil to be more concise and useful. [Nicholas Seckar]
|
||||||
|
|
||||||
* Added Enumerable#first_match [Nicholas Seckar]
|
* Added Enumerable#first_match [Nicholas Seckar]
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
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
|
Loading…
Reference in New Issue