Class: Undercover::LcovParser
- Inherits:
-
Object
- Object
- Undercover::LcovParser
- Defined in:
- lib/undercover/lcov_parser.rb
Instance Attribute Summary collapse
-
#io ⇒ Object
readonly
Returns the value of attribute io.
-
#source_files ⇒ Object
readonly
Returns the value of attribute source_files.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(lcov_io) ⇒ LcovParser
constructor
A new instance of LcovParser.
- #parse ⇒ Object
Constructor Details
#initialize(lcov_io) ⇒ LcovParser
Returns a new instance of LcovParser.
9 10 11 12 |
# File 'lib/undercover/lcov_parser.rb', line 9 def initialize(lcov_io) @io = lcov_io @source_files = {} end |
Instance Attribute Details
#io ⇒ Object (readonly)
Returns the value of attribute io.
7 8 9 |
# File 'lib/undercover/lcov_parser.rb', line 7 def io @io end |
#source_files ⇒ Object (readonly)
Returns the value of attribute source_files.
7 8 9 |
# File 'lib/undercover/lcov_parser.rb', line 7 def source_files @source_files end |
Class Method Details
.parse(lcov_report_path) ⇒ Object
14 15 16 17 |
# File 'lib/undercover/lcov_parser.rb', line 14 def self.parse(lcov_report_path) lcov_io = File.open(lcov_report_path) new(lcov_io).parse end |
Instance Method Details
#parse ⇒ Object
19 20 21 22 23 |
# File 'lib/undercover/lcov_parser.rb', line 19 def parse io.each(&method(:parse_line)) io.close self end |