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

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/docile-1.4.0/lib/docile/backtrace_filter.rb
docile-1.4.0 lib/docile/backtrace_filter.rb