提交 f9a02b12 编写于 作者: D David Heinemeier Hansson

Added gem backtrace pretty priting (Juan Lupión) [#1497 state:committed]

上级 4dcd8f01
......@@ -9,6 +9,8 @@ class BacktraceCleaner < ActiveSupport::BacktraceCleaner
RAILS_NOISE = %w( script/server )
RUBY_NOISE = %w( rubygems/custom_require benchmark.rb )
GEMS_DIR = Gem.default_dir
ALL_NOISE = VENDOR_DIRS + SERVER_DIRS + RAILS_NOISE + RUBY_NOISE
def initialize
......@@ -16,6 +18,7 @@ def initialize
add_filter { |line| line.sub(RAILS_ROOT, '') }
add_filter { |line| line.sub(ERB_METHOD_SIG, '') }
add_filter { |line| line.sub('./', '/') } # for tests
add_filter { |line| line.sub(/(#{GEMS_DIR})\/gems\/([a-z]+)-([0-9.]+)\/(.*)/, '\2 (\3) \4')} # http://gist.github.com/30430
add_silencer { |line| ALL_NOISE.any? { |dir| line.include?(dir) } }
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册