Class: CodeCoverage::CoverageParser
- Inherits:
-
Object
- Object
- CodeCoverage::CoverageParser
- Defined in:
- lib/code_coverage/coverage_parser.rb
Overview
Parse json files of code-coverage-api plugin and converts it into an array of [CoverageItem]. Empty array if not parseable.
Instance Method Summary collapse
-
#parse(content) ⇒ Array<CoverageItem>
Parse json string into [CoverageItem] array.
Instance Method Details
#parse(content) ⇒ Array<CoverageItem>
Parse json string into [CoverageItem] array.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/code_coverage/coverage_parser.rb', line 14 def parse(content) raw_json = begin JSON.parse(content) # rubocop:disable Style/RescueStandardError rescue # rubocop:enable Style/RescueStandardError {} end parse_coverage(raw_json) end |