covered 0.22.0 → 0.22.1

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: 4eef14f82ea11c36cec4db5d1a8293db47c3df546ab0308be7980b52417b13d0
4
- data.tar.gz: e215cd555534a34c750b39092e2783837b264a6caf4bfbf2e667c5cc3284d309
3
+ metadata.gz: c83b08be821b20f583a8e9f7c0c5eff4ded0852016e73e93d3a29f63ed33d79b
4
+ data.tar.gz: 8a8cf40418633108d9b5bbb491eaf0c06dc7be5f53a11f2bbc3fac4abfca5cd3
5
5
  SHA512:
6
- metadata.gz: e0d71b6b5984a3c81a0143a3ee85f9d966fc0b4b2d0863b86da4164af1892ccb5a02b76e4c4761b1d351044d2fc99da9788e9e97e14d8a6fe6a8211c6d88da94
7
- data.tar.gz: 0be7f62a27e2f7bf7d94f3fd560fa76f9b05b9aacdf8a6a094ae4d140b99303302870f9dc92550e4074314c838ecb3497e34ef08fb87bc7cd1c0723e6c7339dc
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
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2018-2023, by Samuel Williams.
5
5
 
6
6
  module Covered
7
- VERSION = "0.22.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.22.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-07-13 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
metadata.gz.sig CHANGED
Binary file