Skip to content
Browse files

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

  • Loading branch information...
1 parent 4dcd8f0 commit f9a02b12d15bdbd3c2ed18b16b31b712a77027bc @dhh dhh committed Dec 15, 2008
Showing with 3 additions and 0 deletions.
  1. +3 −0 railties/lib/rails/backtrace_cleaner.rb
View
3 railties/lib/rails/backtrace_cleaner.rb
@@ -9,13 +9,16 @@ 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
super
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

0 comments on commit f9a02b1

Please sign in to comment.
Something went wrong with that request. Please try again.