Class: Airbrake::Filters::RootDirectoryFilter Private
- Inherits:
-
Object
- Object
- Airbrake::Filters::RootDirectoryFilter
- Defined in:
- lib/airbrake-ruby/filters/root_directory_filter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Replaces root directory with a label.
Constant Summary collapse
- PROJECT_ROOT_LABEL =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'/PROJECT_ROOT'.freeze
Instance Attribute Summary collapse
- #weight ⇒ Integer readonly private
Instance Method Summary collapse
-
#call(notice) ⇒ void
private
This is a mandatory method required by any filter integrated with FilterChain.
-
#initialize(root_directory) ⇒ RootDirectoryFilter
constructor
private
A new instance of RootDirectoryFilter.
Constructor Details
#initialize(root_directory) ⇒ RootDirectoryFilter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RootDirectoryFilter.
12 13 14 15 |
# File 'lib/airbrake-ruby/filters/root_directory_filter.rb', line 12 def initialize(root_directory) @root_directory = root_directory @weight = 100 end |
Instance Attribute Details
#weight ⇒ Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/airbrake-ruby/filters/root_directory_filter.rb', line 10 def weight @weight end |
Instance Method Details
#call(notice) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
This is a mandatory method required by any filter integrated with FilterChain.
18 19 20 21 22 23 24 25 26 |
# File 'lib/airbrake-ruby/filters/root_directory_filter.rb', line 18 def call(notice) notice[:errors].each do |error| error[:backtrace].each do |frame| next unless (file = frame[:file]) file.sub!(/\A#{@root_directory}/, PROJECT_ROOT_LABEL) end end end |