Class: Telebugs::Middleware::GemRootFilter

Inherits:
BaseMiddleware show all
Defined in:
lib/telebugs/middleware/gem_root_filter.rb

Overview

GemRootFilter is a middleware that filters out the root path of the gems. It replaces the root path with the gem name and version.

Constant Summary

Constants inherited from BaseMiddleware

BaseMiddleware::DEFAULT_WEIGHT

Instance Method Summary collapse

Constructor Details

#initializeGemRootFilter

Returns a new instance of GemRootFilter.



8
9
10
# File 'lib/telebugs/middleware/gem_root_filter.rb', line 8

def initialize
  @gem_paths = Gem.path.map { |path| /\A#{Regexp.escape(path)}\/gems\// }
end

Instance Method Details

#call(report) ⇒ Object



12
13
14
15
16
# File 'lib/telebugs/middleware/gem_root_filter.rb', line 12

def call(report)
  report.data[:errors].each do |error|
    process_backtrace(error[:backtrace])
  end
end

#weightObject



18
19
20
# File 'lib/telebugs/middleware/gem_root_filter.rb', line 18

def weight
  -999
end