Class: TLDR::BacktraceFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/tldr/backtrace_filter.rb

Constant Summary collapse

BASE_PATH =
__dir__.freeze

Instance Method Summary collapse

Instance Method Details

#filter(backtrace) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/tldr/backtrace_filter.rb', line 5

def filter backtrace
  return ["No backtrace"] unless backtrace
  return backtrace.dup if $DEBUG

  trim_leading_frames(backtrace) ||
    trim_internal_frames(backtrace) ||
    backtrace.dup
end