Sha256: 7858931002f0d32e1ec220b57437200785034e2aca1657d5825760054eddba8f
Contents?: true
Size: 792 Bytes
Versions: 8
Compression:
Stored size: 792 Bytes
Contents
module MetricFu class RCovLine attr_accessor :content, :was_run def initialize(content, was_run) @content = content @was_run = was_run end def to_h { content: @content, was_run: @was_run } end def covered? @was_run == 1 end def missed? @was_run == 0 end def ignored? @was_run.nil? end def self.line_coverage(lines) lines.map { |line| line[:was_run] } end def self.covered_lines(line_coverage) line_coverage.count(1) end def self.missed_lines(line_coverage) line_coverage.count(0) end def self.ignored_lines(line_coverage) line_coverage.count(nil) end def css_class return "rcov_not_run" if missed? "rcov_run" end end end
Version data entries
8 entries across 8 versions & 3 rubygems