Module: WarningSigns::CallerHelper

Included in:
MessageFormatter::Base, RubyDeprecationCatcher
Defined in:
lib/warning_signs/caller_helper.rb

Instance Method Summary collapse

Instance Method Details

#caller_filteredObject



3
4
5
6
7
# File 'lib/warning_signs/caller_helper.rb', line 3

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

#ignore_line(line, filter_backtraces: "yes".inquiry) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/warning_signs/caller_helper.rb', line 9

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