Sha256: 9a88f1e6ca4c32f5feb529ed5daedb564f65187e299e3b202a61b4d6e458c5c7

Contents?: true

Size: 644 Bytes

Versions: 8

Compression:

Stored size: 644 Bytes

Contents

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 = /lib\/docile/

    def backtrace
      super.select { |trace| trace !~ FILTER_PATTERN }
    end

    if ::Exception.public_method_defined?(:backtrace_locations)
      def backtrace_locations
        super.select { |location| location.absolute_path !~ FILTER_PATTERN }
      end
    end
  end
end

Version data entries

8 entries across 5 versions & 2 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/docile-1.3.4/lib/docile/backtrace_filter.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/docile-1.3.5/lib/docile/backtrace_filter.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/docile-1.3.5/lib/docile/backtrace_filter.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/docile-1.3.4/lib/docile/backtrace_filter.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/docile-1.3.5/lib/docile/backtrace_filter.rb
docile-1.3.5 lib/docile/backtrace_filter.rb
docile-1.3.4 lib/docile/backtrace_filter.rb
docile-1.3.3 lib/docile/backtrace_filter.rb