Sha256: a83101cbb64cbfd152698c41a40a65f75c3b73c6ca340b79249551df42f1f542

Contents?: true

Size: 579 Bytes

Versions: 5

Compression:

Stored size: 579 Bytes

Contents

module WarningSigns
  module CallerHelper
    def caller_filtered
      caller.reject do |location|
        ignore_line(location.to_s)
      end
    end

    def ignore_line(line, filter_backtraces: "yes".inquiry)
      return false if filter_backtraces.no?
      partial_result = line.include?("<internal:") ||
        line.include?("warning_signs/lib") ||
        line.include?("warning_signs/spec")
      return partial_result if filter_backtraces.filter_internals?
      partial_result ||
        line.include?("rubygems") ||
        line.include?("/gems")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
warning_signs-0.7.2 lib/warning_signs/caller_helper.rb
warning_signs-0.7.1 lib/warning_signs/caller_helper.rb
warning_signs-0.7.0 lib/warning_signs/caller_helper.rb
warning_signs-0.6.1 lib/warning_signs/caller_helper.rb
warning_signs-0.6.0 lib/warning_signs/caller_helper.rb