Class: StudFinder::Coverage::Lcov
- Inherits:
-
Object
- Object
- StudFinder::Coverage::Lcov
- Defined in:
- lib/stud_finder/coverage/lcov.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#missing_files ⇒ Object
readonly
Returns the value of attribute missing_files.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(path:, files:, project_root: nil) ⇒ Lcov
constructor
A new instance of Lcov.
Constructor Details
#initialize(path:, files:, project_root: nil) ⇒ Lcov
Returns a new instance of Lcov.
12 13 14 15 16 17 18 |
# File 'lib/stud_finder/coverage/lcov.rb', line 12 def initialize(path:, files:, project_root: nil) @path = path @files = files @file_set = Set.new(files) @project_root = File.(project_root) if project_root @missing_files = [] end |
Instance Attribute Details
#missing_files ⇒ Object (readonly)
Returns the value of attribute missing_files.
10 11 12 |
# File 'lib/stud_finder/coverage/lcov.rb', line 10 def missing_files @missing_files end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 |
# File 'lib/stud_finder/coverage/lcov.rb', line 20 def call reported = parse_report @missing_files = @files.reject { |file| reported.key?(file) } @files.to_h { |file| [file, reported.fetch(file, 0.0)] } end |