Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit f9a02b12d15bdbd3c2ed18b16b31b712a77027bc 1 parent 4dcd8f0
David Heinemeier Hansson dhh authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  railties/lib/rails/backtrace_cleaner.rb
3  railties/lib/rails/backtrace_cleaner.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.