Sha256: b1f0073c5f4c24062f19c9cbdb4a1677a19ca39c56cf886cdb8c4706116bfb06
Contents?: true
Size: 736 Bytes
Versions: 74
Compression:
Stored size: 736 Bytes
Contents
# frozen_string_literal: true require "active_support/backtrace_cleaner" require "active_support/core_ext/string/access" module Rails class BacktraceCleaner < ActiveSupport::BacktraceCleaner APP_DIRS_PATTERN = /\A(?:\.\/)?(?:app|config|lib|test|\(\w*\))/ RENDER_TEMPLATE_PATTERN = /:in `.*_\w+_{2,3}\d+_\d+'/ 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 end end
Version data entries
74 entries across 70 versions & 6 rubygems