Sha256: dbfaaaf8eb63d36708802fd597d1cd4a8299a3169449696399e81a2b3243053c
Contents?: true
Size: 685 Bytes
Versions: 14
Compression:
Stored size: 685 Bytes
Contents
# frozen_string_literal: true module Docile # @api private # # This is used to remove entries pointing to Docile's source files # from {Exception#backtrace} and {Exception#backtrace_locations}. # # If {NoMethodError} is caught then the exception object will be extended # by this module to add filter functionalities. module BacktraceFilter FILTER_PATTERN = %r{/lib/docile/}.freeze def backtrace super.reject { |trace| trace =~ FILTER_PATTERN } end if ::Exception.public_method_defined?(:backtrace_locations) def backtrace_locations super.reject { |location| location.absolute_path =~ FILTER_PATTERN } end end end end
Version data entries
14 entries across 11 versions & 5 rubygems