single_cov 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/single_cov.rb +11 -2
- data/lib/single_cov/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a086ee2f32cf635cc63929751ba9440fd473b9a5b6f6f5cae7e4546efd4db56
|
4
|
+
data.tar.gz: 7a8a8a4d601f53d79ed45b93e1eb7f06fc7b917fd01ffc41d7e3e02bf1f0825c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff29c57455d8fe0b7a16d14a58b5efb2d97a5cbbca25b03da77f322e4443e12e378f7ce5156770f5907f1db10a543907b5a0ea1d87950e2d05237edff9d28a2f
|
7
|
+
data.tar.gz: 16eb10a22563b11c53e67b5037ce0b5f6d867435844fd3f153f6cdb892ffe4a3a46c113e6732fc1895bbb6c6bd17e7d5c3666c636b24c23c78a48cfd1a46eae9
|
data/lib/single_cov.rb
CHANGED
@@ -6,9 +6,12 @@ module SingleCov
|
|
6
6
|
UNCOVERED_COMMENT_MARKER = "uncovered"
|
7
7
|
|
8
8
|
class << self
|
9
|
-
# enable coverage reporting, changed by forking-test-runner to combine multiple reports
|
9
|
+
# enable coverage reporting: location of output file, changed by forking-test-runner to combine multiple reports
|
10
10
|
attr_accessor :coverage_report
|
11
11
|
|
12
|
+
# emit only line coverage in coverage report for older coverage systems
|
13
|
+
attr_accessor :coverage_report_lines
|
14
|
+
|
12
15
|
# optionally rewrite the file we guessed with a lambda
|
13
16
|
def rewrite(&block)
|
14
17
|
@rewrite = block
|
@@ -375,8 +378,14 @@ module SingleCov
|
|
375
378
|
|
376
379
|
used = COVERAGES.map { |f, _| "#{root}/#{f}" }
|
377
380
|
covered = results.select { |k, _| used.include?(k) }
|
381
|
+
|
382
|
+
if coverage_report_lines
|
383
|
+
covered = covered.each_with_object({}) { |(k, v), h| h[k] = v.is_a?(Hash) ? v.fetch(:lines) : v }
|
384
|
+
end
|
385
|
+
|
386
|
+
# chose "Minitest" because it is what simplecov uses for reports and "Unit Tests" makes sonarqube break
|
378
387
|
data = JSON.pretty_generate(
|
379
|
-
"
|
388
|
+
"Minitest" => {"coverage" => covered, "timestamp" => Time.now.to_i }
|
380
389
|
)
|
381
390
|
FileUtils.mkdir_p(File.dirname(report))
|
382
391
|
File.write report, data
|
data/lib/single_cov/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: single_cov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|