class RubocopJunitFailure

Attributes

file_path[RW]
line[RW]
message[RW]
severity[RW]

Public Class Methods

new(failure:, path: Dir.pwd) click to toggle source
# 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.message = failure.attributes['message'].value
  self.line = file_matches[2].to_i
end

Private Instance Methods

file_path_regex() click to toggle source
# File lib/rubocop_junit_parser/rubocop_junit_failure.rb, line 13
def file_path_regex
  /(.*):(\d+):(\d+)/
end