firespring_dev_commands 2.1.21.pre.alpha.6 → 2.1.21.pre.alpha.7

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: 998d0c1c4b6fe67c9cbe55859df58e6981c35b4b290f3f97ca3f5002450ac532
4
- data.tar.gz: e5925dcb8074fc053a009ad00039b15ac7c0a18d2e2997d392a7ab3fcb52f2b0
3
+ metadata.gz: 8854ab66747e26c22780c4e6756df86dac09bc5a8029fae51f1382d29d18c27f
4
+ data.tar.gz: ca3ddd354a8faddb180d827891886ce78483accb7e7f1e2e5b5b9d6bcc9d36f7
5
5
  SHA512:
6
- metadata.gz: ac1ff30a2ab2b72fbd30dbdc2d77699f1e15b648f7d33974bc37a5d1ddd94d385c44739c37b29de74e40bb7bb33215dffd9c65b387abaf001b29b840c160bae0
7
- data.tar.gz: 309d92d6c32a731163e0b44a11613079bfb7df216a65e54cfe6a1391f94cd4f74919698eac79b9be5a884a71d728503930a043850afcfc2b7e49c5bc280e0e06
6
+ metadata.gz: 4aace4ef89ab6ec98008184ffb58d71febc920bcc85195a3fe2fa645a4109f8523348cdfae5e281a731d6ce6ddac3769a101800ee7b6e63ad31f4efcfa2f84c4
7
+ data.tar.gz: c700fd928018dc384757fddeae412eb4990323b94b47a16026736738d43e4a8ff12202b15014ebd0b92d30f5705dcffeab439a78e61ea711e0074ecff22d6cec
@@ -9,7 +9,7 @@ module Dev
9
9
  @filename = filename
10
10
  @local_filename = File.join(local_path || '.', @filename)
11
11
  @container_filename = File.join(container_path || '.', @filename)
12
- @threshold = threshold.to_f
12
+ @threshold = threshold
13
13
  end
14
14
 
15
15
  # Remove any previous versions of the local file that will be output
@@ -32,10 +32,24 @@ module Dev
32
32
 
33
33
  # Load the file from disk and parse with ox
34
34
  report = Ox.load(File.read(local_filename), mode: :hash)
35
- attrs, = report[:coverage]
36
- cov_pct = attrs[:'line-rate'].to_f * 100
37
- puts format('Line coverage was %.2f%%. Configured threshold was %.2f%%', cov_pct, threshold)
38
- raise 'Code coverage not met' if cov_pct < threshold
35
+ _, _, files = report[:coverage]
36
+
37
+ covered = missed = 0
38
+ files.dig(:packages, :package)&.each do |_attrs, packages|
39
+ _, _, lines = *packages&.dig(:classes, :class)
40
+ lines&.dig(:lines, :line)&.each do |it|
41
+ it = it&.first if it.is_a?(Array)
42
+ if it&.dig(:hits).to_i.positive?
43
+ covered += 1
44
+ else
45
+ missed += 1
46
+ end
47
+ end
48
+ end
49
+
50
+ puts "Lines missing coverage was #{missed}"
51
+ puts "Configured threshold was #{threshold}" if threshold
52
+ raise 'Code coverage not met' if threshold && missed > threshold
39
53
  end
40
54
  end
41
55
  end
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.1.21.pre.alpha.6'.freeze
9
+ VERSION = '2.1.21.pre.alpha.7'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.21.pre.alpha.6
4
+ version: 2.1.21.pre.alpha.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-18 00:00:00.000000000 Z
11
+ date: 2023-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport