Module: AbideDevUtils::Sce::Generate::CoverageReport
- Defined in:
- lib/abide_dev_utils/sce/generate/coverage_report.rb
Overview
Methods and objects used to construct a report of what SCE enforces versus what the various compliance frameworks expect to be enforced.
Defined Under Namespace
Classes: BenchmarkReport, Filter, ReportOptions, ReportOutput
Class Method Summary collapse
-
.generate(format_func: :to_h, opts: {}) ⇒ Object
Generate a coverage report for a Puppet module.
Class Method Details
.generate(format_func: :to_h, opts: {}) ⇒ Object
Generate a coverage report for a Puppet module
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/abide_dev_utils/sce/generate/coverage_report.rb', line 25 def self.generate(format_func: :to_h, opts: {}) opts = ReportOptions.new(opts) benchmarks = AbideDevUtils::Sce::BenchmarkLoader.benchmarks_from_puppet_module( ignore_all_errors: opts.ignore_benchmark_errors ) benchmarks.filter_map do |b| next if opts.benchmark && !Regexp.new(Regexp.escape(opts.benchmark)).match?(b.title_key) next if opts.profile && b.mapper.profiles.none?(opts.profile) next if opts.level && b.mapper.levels.none?(opts.level) BenchmarkReport.new(b, opts).run.send(format_func) end end |