Class: Telebugs::Middleware::GemRootFilter
- Inherits:
-
BaseMiddleware
- Object
- BaseMiddleware
- Telebugs::Middleware::GemRootFilter
- 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
- #call(report) ⇒ Object
-
#initialize ⇒ GemRootFilter
constructor
A new instance of GemRootFilter.
- #weight ⇒ Object
Constructor Details
#initialize ⇒ GemRootFilter
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 |
#weight ⇒ Object
18 19 20 |
# File 'lib/telebugs/middleware/gem_root_filter.rb', line 18 def weight -999 end |