Class: SimpleCov::Formatter::AIFormatter::MarkdownBuilder::BranchEnricher

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/simplecov-ai/markdown_builder/branch_enricher.rb

Overview

Enriches SimpleCov branch data with column information from raw coverage data.

Class Method Summary collapse

Class Method Details

.enrich(file) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/simplecov-ai/markdown_builder/branch_enricher.rb', line 13

def self.enrich(file)
  return unless file.respond_to?(:coverage_data)

  case (cov = file.coverage_data)
  when Hash
    case (branches = cov['branches'])
    when Hash
      process_branches(file, branches)
    end
  end
rescue StandardError
  nil
end