Improve BacktraceCleaner code example [ci-skip]

With newer rubies, removing a prefix is much simpler.
This commit is contained in:
Jean Boussier 2024-06-19 09:16:30 +02:00
parent ff0ef93e28
commit 869c7bf094

@ -18,7 +18,7 @@ module ActiveSupport
#
# bc = ActiveSupport::BacktraceCleaner.new
# root = "#{Rails.root}/"
# bc.add_filter { |line| line.start_with?(root) ? line.from(root.size) : line } # strip the Rails.root prefix
# bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix
# bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems
# bc.clean(exception.backtrace) # perform the cleanup
#