Sha256: 0057d7489ad66f063f2754aa43ef600277097d9b0d815d88b9e725c59cd65978
Contents?: true
Size: 771 Bytes
Versions: 13
Compression:
Stored size: 771 Bytes
Contents
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2022-2023, by Samuel Williams. def initialize(context) super require_relative '../../lib/covered' end # Debug the coverage of a file. Show which lines should be executable. # # @parameter paths [Array(String)] The paths to parse. # @parameter execute [Boolean] Whether to execute the code. def parse(paths: [], execute: false) files = output = Covered::Files.new output = Covered::Source.new(output) paths.each do |path| output.mark(path, 0, 0) end if execute capture = Covered::Capture.new(output) capture.start paths.each do |path| load path end capture.finish files.paths = files.paths.slice(*paths) end Covered::Summary.new.call(output, $stderr) end
Version data entries
13 entries across 13 versions & 1 rubygems