Skip to content

Commit

Permalink
Added gem backtrace pretty priting (Juan Lupión) [rails#1497 state:co…
Browse files Browse the repository at this point in the history
…mmitted]
  • Loading branch information
dhh committed Dec 15, 2008
1 parent 4dcd8f0 commit f9a02b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions railties/lib/rails/backtrace_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f9a02b1

Please sign in to comment.