Class: RubocopJunitFailure
- Inherits:
-
Object
- Object
- RubocopJunitFailure
- Defined in:
- lib/rubocop_junit_parser/rubocop_junit_failure.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#line ⇒ Object
Returns the value of attribute line.
-
#message ⇒ Object
Returns the value of attribute message.
-
#severity ⇒ Object
Returns the value of attribute severity.
Instance Method Summary collapse
-
#initialize(failure:, path: Dir.pwd) ⇒ RubocopJunitFailure
constructor
A new instance of RubocopJunitFailure.
Constructor Details
#initialize(failure:, path: Dir.pwd) ⇒ RubocopJunitFailure
Returns a new instance of RubocopJunitFailure.
4 5 6 7 8 9 |
# File 'lib/rubocop_junit_parser/rubocop_junit_failure.rb', line 4 def initialize(failure:, path: Dir.pwd) file_matches = failure.children.first.text.strip.match(file_path_regex) self.file_path = file_matches[1].gsub("#{path}/", '') self. = failure.attributes['message'].value self.line = file_matches[2].to_i end |
Instance Attribute Details
#file_path ⇒ Object
Returns the value of attribute file_path.
2 3 4 |
# File 'lib/rubocop_junit_parser/rubocop_junit_failure.rb', line 2 def file_path @file_path end |
#line ⇒ Object
Returns the value of attribute line.
2 3 4 |
# File 'lib/rubocop_junit_parser/rubocop_junit_failure.rb', line 2 def line @line end |
#message ⇒ Object
Returns the value of attribute message.
2 3 4 |
# File 'lib/rubocop_junit_parser/rubocop_junit_failure.rb', line 2 def @message end |
#severity ⇒ Object
Returns the value of attribute severity.
2 3 4 |
# File 'lib/rubocop_junit_parser/rubocop_junit_failure.rb', line 2 def severity @severity end |