diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-12-15 15:37:27 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-12-15 15:37:27 +0100 |
commit | f9a02b12d15bdbd3c2ed18b16b31b712a77027bc (patch) | |
tree | cb888aab72c0652eb7bcf44da5860b9369bb2a4c | |
parent | 4dcd8f01afe5800baa67bbdf72832afb0d627755 (diff) | |
download | rails-f9a02b12d15bdbd3c2ed18b16b31b712a77027bc.tar.gz rails-f9a02b12d15bdbd3c2ed18b16b31b712a77027bc.tar.bz2 rails-f9a02b12d15bdbd3c2ed18b16b31b712a77027bc.zip |
Added gem backtrace pretty priting (Juan LupiĆ³n) [#1497 state:committed]
-rw-r--r-- | railties/lib/rails/backtrace_cleaner.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/railties/lib/rails/backtrace_cleaner.rb b/railties/lib/rails/backtrace_cleaner.rb index f344c6477d..94d34cda39 100644 --- a/railties/lib/rails/backtrace_cleaner.rb +++ b/railties/lib/rails/backtrace_cleaner.rb @@ -9,6 +9,8 @@ module Rails 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 @@ module Rails 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 |