Sha256: 8ed6d2467c3cbc2b24d50cbdd9f0536531840d82385bd84fc084c4f81ee66dec

Contents?: true

Size: 422 Bytes

Versions: 2

Compression:

Stored size: 422 Bytes

Contents

class RubocopJunitFailure
  attr_accessor :line, :severity, :message, :file_path

  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

  def file_path_regex
    /(.*):(\d+):(\d+)/
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
danger-rubocop_junit_parser-0.0.2 lib/rubocop_junit_parser/rubocop_junit_failure.rb
danger-rubocop_junit_parser-0.0.1 lib/rubocop_junit_parser/rubocop_junit_failure.rb