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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cd1fb991b879dcaf753d2aa30c4f94ac3f97659cf602df4f9adab874046c16f
4
- data.tar.gz: c2351364b4482ceff98314b881fd5b774e9040c117479674b8fb41c0b550dac4
3
+ metadata.gz: 8a086ee2f32cf635cc63929751ba9440fd473b9a5b6f6f5cae7e4546efd4db56
4
+ data.tar.gz: 7a8a8a4d601f53d79ed45b93e1eb7f06fc7b917fd01ffc41d7e3e02bf1f0825c
5
5
  SHA512:
6
- metadata.gz: 813924bc4aaad528db8afe9640178f3cfad2c11ffa4042573e4810a83cf941014e3d77352436b1c999330c70c066619054b88a3117e5d87885f95ce619dfaf2d
7
- data.tar.gz: 31915f85ff52971fb4691f1fe52680c026b8f8e70c6b390b0c538e84ced5e59b035803130f09d5df03f4eba7731608c46f02ba28df366506322559495baf588d
6
+ metadata.gz: ff29c57455d8fe0b7a16d14a58b5efb2d97a5cbbca25b03da77f322e4443e12e378f7ce5156770f5907f1db10a543907b5a0ea1d87950e2d05237edff9d28a2f
7
+ data.tar.gz: 16eb10a22563b11c53e67b5037ce0b5f6d867435844fd3f153f6cdb892ffe4a3a46c113e6732fc1895bbb6c6bd17e7d5c3666c636b24c23c78a48cfd1a46eae9
@@ -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
- "Unit Tests" => {"coverage" => covered, "timestamp" => Time.now.to_i }
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
@@ -1,3 +1,3 @@
1
1
  module SingleCov
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.0"
3
3
  end
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.0
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-24 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it