Module: SimcovAiFormatter
- Defined in:
- lib/simcov_ai_formatter.rb,
lib/simcov_ai_formatter/errors.rb,
lib/simcov_ai_formatter/version.rb,
lib/simcov_ai_formatter/renderer.rb,
lib/simcov_ai_formatter/formatter.rb,
lib/simcov_ai_formatter/suite_merger.rb,
lib/simcov_ai_formatter/source_reader.rb,
lib/simcov_ai_formatter/resultset_loader.rb,
lib/simcov_ai_formatter/simple_cov_formatter.rb
Defined Under Namespace
Classes: Error, Formatter, InvalidResultset, Renderer, ResultsetLoader, ResultsetNotFound, SimpleCovFormatter, SourceReader, SuiteMerger, SuiteNotFound
Constant Summary collapse
- DEFAULT_RESULTSET_PATH =
"coverage/.resultset.json".freeze
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.format(path, root: Dir.pwd, suite: nil, with_source: false, context: 2, source_warnings: nil) ⇒ Hash
Public API: convert resultset.json into an AI-friendly Hash.
Class Method Details
.format(path, root: Dir.pwd, suite: nil, with_source: false, context: 2, source_warnings: nil) ⇒ Hash
Public API: convert resultset.json into an AI-friendly Hash.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/simcov_ai_formatter.rb', line 21 def self.format(path, root: Dir.pwd, suite: nil, with_source: false, context: 2, source_warnings: nil) raw = ResultsetLoader.new(path).load selected_suite, coverage = SuiteMerger.new(raw, suite: suite).select source_reader = with_source ? SourceReader.new(warnings: source_warnings) : nil Formatter.new( coverage: coverage, suite: selected_suite, suites_merged: suite.nil? ? raw.keys : nil, root: root, with_source: with_source, context: context, source_reader: source_reader ).call end |