Class: Airbrake::Filters::GitRevisionFilter Private
- Inherits:
-
Object
- Object
- Airbrake::Filters::GitRevisionFilter
- Defined in:
- lib/airbrake-ruby/filters/git_revision_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.
Attaches current git revision to ‘context`.
Constant Summary collapse
- PREFIX =
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.
'ref: '.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) ⇒ GitRevisionFilter
constructor
private
A new instance of GitRevisionFilter.
Constructor Details
#initialize(root_directory) ⇒ GitRevisionFilter
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 GitRevisionFilter.
14 15 16 17 18 |
# File 'lib/airbrake-ruby/filters/git_revision_filter.rb', line 14 def initialize(root_directory) @git_path = File.join(root_directory, '.git') @revision = nil @weight = 116 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.
8 9 10 |
# File 'lib/airbrake-ruby/filters/git_revision_filter.rb', line 8 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.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/airbrake-ruby/filters/git_revision_filter.rb', line 21 def call(notice) return if notice[:context].key?(:revision) if @revision notice[:context][:revision] = @revision return end return unless File.exist?(@git_path) @revision = find_revision return unless @revision notice[:context][:revision] = @revision end |