Module: Bullet::StackTraceFilter
- Included in:
- Detector::NPlusOneQuery, Detector::UnusedEagerLoading
- Defined in:
- lib/bullet/stack_trace_filter.rb
Constant Summary collapse
- VENDOR_PATH =
'/vendor'
Instance Method Summary collapse
Instance Method Details
#caller_in_project(bullet_key = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bullet/stack_trace_filter.rb', line 12 def caller_in_project(bullet_key = nil) vendor_root = Bullet.app_root + VENDOR_PATH bundler_path = Bundler.bundle_path.to_s select_caller_locations(bullet_key) do |location| caller_path = location_as_path(location) caller_path.include?(Bullet.app_root) && !caller_path.include?(vendor_root) && !caller_path.include?(bundler_path) || Bullet.stacktrace_includes.any? { |include_pattern| pattern_matches?(location, include_pattern) } end end |
#excluded_stacktrace_path? ⇒ Boolean
24 25 26 27 28 |
# File 'lib/bullet/stack_trace_filter.rb', line 24 def excluded_stacktrace_path? Bullet.stacktrace_excludes.any? do |exclude_pattern| caller_in_project.any? { |location| pattern_matches?(location, exclude_pattern) } end end |