class ActiveSupport::BacktraceCleaner

def add_silencer(&block)

backtrace_cleaner.add_silencer { |line| /puma/.match?(line) }
# Will reject all lines that include the word "puma", like "/gems/puma/server.rb" or "/app/my_puma_server/rb"

for a given line, it will be excluded from the clean backtrace.
Adds a silencer from the block provided. If the silencer returns +true+
def add_silencer(&block)
  @silencers << block
end