123456789_123456789_123456789_123456789_123456789_

Class: Rails::BacktraceCleaner

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveSupport::BacktraceCleaner
Defined in: railties/lib/rails/backtrace_cleaner.rb

Constant Summary

::ActiveSupport::BacktraceCleaner - Inherited

FORMATTED_GEMS_PATTERN

Class Method Summary

Instance Method Summary

::ActiveSupport::BacktraceCleaner - Inherited

#add_filter

Adds a filter from the block provided.

#add_silencer

Adds a silencer from the block provided.

#clean

Returns the backtrace after all filters and silencers have been run against it.

#filter
#remove_filters!

Removes all filters, but leaves in the silencers.

#remove_silencers!

Removes all silencers, but leaves in the filters.

Constructor Details

.newBacktraceCleaner

[ GitHub ]

  
# File 'railties/lib/rails/backtrace_cleaner.rb', line 11

def initialize
  super
  @root = "#{Rails.root}/"
  add_filter do |line|
    line.start_with?(@root) ? line.from(@root.size) : line
  end
  add_filter do |line|
    if RENDER_TEMPLATE_PATTERN.match?(line)
      line.sub(RENDER_TEMPLATE_PATTERN, "")
    else
      line
    end
  end
  add_silencer { |line| !APP_DIRS_PATTERN.match?(line) }
end