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
-
APP_DIRS_PATTERN =
# File 'railties/lib/rails/backtrace_cleaner.rb', line 7/^\/?(app|config|lib|test|\(\w*\))/
-
DOT_SLASH =
# File 'railties/lib/rails/backtrace_cleaner.rb', line 11"./".freeze
-
EMPTY_STRING =
# File 'railties/lib/rails/backtrace_cleaner.rb', line 9"".freeze
-
RENDER_TEMPLATE_PATTERN =
# File 'railties/lib/rails/backtrace_cleaner.rb', line 8/:in `_render_template_\w*'/
-
SLASH =
# File 'railties/lib/rails/backtrace_cleaner.rb', line 10"/".freeze
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 | Alias for ActiveSupport::BacktraceCleaner#clean. |
#remove_filters! | Removes all filters, but leaves in the silencers. |
#remove_silencers! | Removes all silencers, but leaves in the filters. |
Constructor Details
.new ⇒ BacktraceCleaner
# File 'railties/lib/rails/backtrace_cleaner.rb', line 13
def initialize super @root = "#{Rails.root}/".freeze add_filter { |line| line.sub(@root, EMPTY_STRING) } add_filter { |line| line.sub(RENDER_TEMPLATE_PATTERN, EMPTY_STRING) } add_filter { |line| line.sub(DOT_SLASH, SLASH) } # for tests add_gem_filters add_silencer { |line| !APP_DIRS_PATTERN.match?(line) } end