covered 0.21.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f81a87dfa60bac921785b65464dac44223ea3a449fc4701e205dd0f8d8bfece0
4
- data.tar.gz: 7812cbe1c1622620bcc2b8dfcc70e9a97eda3cbb84dc5bea7291ce62009f5ec6
3
+ metadata.gz: c83b08be821b20f583a8e9f7c0c5eff4ded0852016e73e93d3a29f63ed33d79b
4
+ data.tar.gz: 8a8cf40418633108d9b5bbb491eaf0c06dc7be5f53a11f2bbc3fac4abfca5cd3
5
5
  SHA512:
6
- metadata.gz: 93b23c3c8ceecffbfb48d1739d0d4fc039f9e0ac90037f0414fb0ee660509d003d52e3618d3bc6ef6151ef4161e81de95e96c780868bac016ad1e7c4fe4ab709
7
- data.tar.gz: e933d87ab654a06c99e11ea505c520ed89f60741241dc18246dca8fb6ff7266c3ddb5fa1b47c45f246de2cc5cd1325d165767a31e5e8ec63e57835138e2b6297
6
+ metadata.gz: 25f75fb59e078f2d89ca296a583a70d3b93817a4bb3e7863dbecc40a0bc13c21d0a0a66a536960c967483f27a036e25063960d40d52c20dde94fe320b34cb634
7
+ data.tar.gz: 7e594df30c68df8df4cf71f0b8063f69dc0e3885d962cc176bbf0a2bf1c2408d6ab6fe2df31f524bcfc5d6162954a7e6f598084d76c851266fad317e0fbb65f0
checksums.yaml.gz.sig CHANGED
Binary file
@@ -15,18 +15,30 @@ end
15
15
  def validate(paths: nil, minimum: 1.0)
16
16
  policy = Covered::Policy.new
17
17
 
18
- paths&.each do |path|
18
+ # Load the default path if no paths are specified:
19
+ paths ||= Dir.glob(Covered::Persist::DEFAULT_PATH, base: context.root)
20
+
21
+ # If no paths are specified, raise an error:
22
+ if paths.empty?
23
+ raise ArgumentError, "No coverage paths specified!"
24
+ end
25
+
26
+ # Load all coverage information:
27
+ paths.each do |path|
19
28
  # It would be nice to have a better algorithm here than just ignoring mtime - perhaps using checksums?
20
29
  Covered::Persist.new(policy.output, path).load!(ignore_mtime: true)
21
30
  end
22
31
 
32
+ # Calculate statistics:
23
33
  statistics = Covered::Statistics.new
24
34
 
25
35
  policy.each do |coverage|
26
36
  statistics << coverage
27
37
  end
28
38
 
39
+ # Print statistics:
29
40
  statistics.print($stderr)
30
41
 
42
+ # Validate statistics and raise an error if they are not met:
31
43
  statistics.validate!(minimum)
32
44
  end
@@ -6,7 +6,7 @@
6
6
  module Covered
7
7
  module Ratio
8
8
  def ratio
9
- return 1 if executable_count.zero?
9
+ return 0 if executable_count.zero?
10
10
 
11
11
  Rational(executed_count, executable_count)
12
12
  end
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2018-2023, by Samuel Williams.
5
5
 
6
6
  module Covered
7
- VERSION = "0.21.0"
7
+ VERSION = "0.22.1"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: covered
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -42,7 +42,7 @@ cert_chain:
42
42
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
43
43
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
44
44
  -----END CERTIFICATE-----
45
- date: 2023-06-30 00:00:00.000000000 Z
45
+ date: 2023-07-17 00:00:00.000000000 Z
46
46
  dependencies:
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: console
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.2.33
122
+ rubygems_version: 3.4.10
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: A modern approach to code coverage.
metadata.gz.sig CHANGED
Binary file