kettle-soup-cover 1.1.2 → 1.1.3

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: f01008c0daa0eceaa622d9f879a064cfc0e035e60bd8a92072182c4a26c45260
4
- data.tar.gz: 7d57d55201e3d214a30bb351b290be94973f88f516d6b96856b489d723d64cfb
3
+ metadata.gz: dda2791fe88ade845707c573dfcb46515ad256d2317f5152a911c64cf2debde2
4
+ data.tar.gz: ec9baad8dfb359b2d4a2557be2b5e51ae7e9ae52273205398ee9b04c31f6cd60
5
5
  SHA512:
6
- metadata.gz: 72b6248a8d8d2bb70ab4a6176ca35da2c2e5395e905afd516224dca6147ebb3d2dadd85f61242769aa2bc8f6ccbabfd4db0d51f7ce200ab9f6b8019b1910067d
7
- data.tar.gz: 0f7da5beaacc56087486cc68349d85eb1b2be0e36ec7225af192767117ea8325916056a703d18eac9950130ca60c9d672e7529fa8434e9408108ded50aabd5c8
6
+ metadata.gz: 79675d22614053323c526e8751a3228fd4b73d0052d0ae57bb109c0b81e814e31f954fef5ac9f61645a838c2157923aedabff853855f570f83b43847b05e9805
7
+ data.tar.gz: 5cf3a65dab1848d2b3cf0cc4ddc6c27b2de91c1ffb2fa5b7191159c45ea48694941c06ffb19fd6f3c70bda55ac852e9ce762ee61e9f4bf35c2374f792bc93ba9
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -28,6 +28,17 @@ Please file a bug if you notice a violation of semantic versioning.
28
28
 
29
29
  ### Fixed
30
30
 
31
+ ### Security
32
+
33
+ ## [1.1.3] - 2026-05-24
34
+
35
+ - TAG: [v1.1.3][1.1.3t]
36
+ - COVERAGE: 96.72% -- 236/244 lines in 11 files
37
+ - BRANCH COVERAGE: 85.71% -- 60/70 branches in 11 files
38
+ - 16.67% documented
39
+
40
+ ### Fixed
41
+
31
42
  - Removed duplicate-load warnings in the spec bootstrap while preserving coverage
32
43
  tracking for the library under test.
33
44
  - Covered Ruby 4.0.5 / SimpleCov branch paths that were causing `bin/rake` to
@@ -40,7 +51,15 @@ Please file a bug if you notice a violation of semantic versioning.
40
51
  - Marked generated workflow files as template-owned to prevent stale YAML keys
41
52
  from surviving future template runs.
42
53
 
43
- ### Security
54
+ - Isolated the spec-helper rake-task coverage exerciser under `tmp/` so
55
+ turbo_tests2 workers cannot delete each other's real coverage artifacts before
56
+ parent-process collation.
57
+ - `turbo_tests:cleanup` now publishes merged worker JSON coverage back to the
58
+ canonical `coverage/coverage.json` path after collating worker resultsets, so
59
+ CI uploaders and release tooling can continue to read standard coverage paths.
60
+ - Parsed `K_SOUP_COV_OPEN_BIN` with shellwords before opening the HTML report so
61
+ opener commands with arguments report unavailable executables consistently
62
+ across Ruby engines.
44
63
 
45
64
  ## [1.1.2] - 2026-05-23
46
65
 
@@ -337,7 +356,9 @@ Please file a bug if you notice a violation of semantic versioning.
337
356
 
338
357
  - Initial release
339
358
 
340
- [Unreleased]: https://github.com/kettle-rb/kettle-soup-cover/compare/v1.1.2...HEAD
359
+ [Unreleased]: https://github.com/kettle-rb/kettle-soup-cover/compare/v1.1.3...HEAD
360
+ [1.1.3]: https://github.com/kettle-rb/kettle-soup-cover/compare/v1.1.2...v1.1.3
361
+ [1.1.3t]: https://github.com/kettle-rb/kettle-soup-cover/releases/tag/v1.1.3
341
362
  [1.1.2]: https://github.com/kettle-rb/kettle-soup-cover/compare/v1.1.1...v1.1.2
342
363
  [1.1.2t]: https://github.com/kettle-rb/kettle-soup-cover/releases/tag/v1.1.2
343
364
  [1.1.1]: https://github.com/kettle-rb/kettle-soup-cover/compare/v1.1.0...v1.1.1
data/README.md CHANGED
@@ -860,7 +860,7 @@ Thanks for RTFM. ☺️
860
860
  [🤝cb-pulls]: https://codeberg.org/kettle-rb/kettle-soup-cover/pulls
861
861
  [🤝cb-donate]: https://donate.codeberg.org/
862
862
  [🤝contributing]: https://github.com/kettle-rb/kettle-soup-cover/blob/main/CONTRIBUTING.md
863
- [🏀codecov-g]: https://codecov.io/gh/kettle-rb/kettle-soup-cover/graphs/tree.svg
863
+ [🏀codecov-g]: https://codecov.io/gh/kettle-rb/kettle-soup-cover/graph/badge.svg
864
864
  [🖐contrib-rocks]: https://contrib.rocks
865
865
  [🖐contributors]: https://github.com/kettle-rb/kettle-soup-cover/graphs/contributors
866
866
  [🖐contributors-img]: https://contrib.rocks/image?repo=kettle-rb/kettle-soup-cover
@@ -878,7 +878,7 @@ Thanks for RTFM. ☺️
878
878
  [📌gitmoji]: https://gitmoji.dev
879
879
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
880
880
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
881
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.203-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
881
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.244-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
882
882
  [🔐security]: https://github.com/kettle-rb/kettle-soup-cover/blob/main/SECURITY.md
883
883
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
884
884
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -903,12 +903,9 @@ Thanks for RTFM. ☺️
903
903
  | Field | Value |
904
904
  |---|---|
905
905
  | Package | kettle-soup-cover |
906
- | Description | 🥘 A Covered Kettle of Test Coverage SOUP (Software of Unknown Provenance)
907
- Four-line SimpleCov config, w/ curated, opinionated, pre-configured, dependencies
908
- for every CI platform, batteries included.
909
- Fund overlooked open source projects - bottom of stack, dev/test dependencies: floss-funding.dev |
906
+ | Description | 🥘 A Covered Kettle of Test Coverage SOUP (Software of Unknown Provenance)<br>Four-line SimpleCov config, w/ curated, opinionated, pre-configured, dependencies<br>for every CI platform, batteries included.<br>Fund overlooked open source projects - bottom of stack, dev/test dependencies: floss-funding.dev |
910
907
  | Homepage | https://github.com/kettle-rb/kettle-soup-cover |
911
- | Source | https://github.com/kettle-rb/kettle-soup-cover/tree/v1.1.2 |
908
+ | Source | https://github.com/kettle-rb/kettle-soup-cover/tree/v1.1.3 |
912
909
  | License | `AGPL-3.0-only` |
913
910
  | Funding | https://github.com/sponsors/pboling, https://issuehunt.io/u/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-rb, https://patreon.com/galtzo, https://polar.sh/pboling, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/kettle-soup-cover, https://www.buymeacoffee.com/pboling |
914
911
  <!-- kettle-jem:metadata:end -->
@@ -1,4 +1,6 @@
1
1
  # NOTE: This is not for CI, only for local development.
2
+ require "shellwords"
3
+
2
4
  desc "Run specs w/ coverage and open results in browser"
3
5
  task :coverage do
4
6
  Kettle::Soup::Cover.reset_const do
@@ -12,20 +14,13 @@ task :coverage do
12
14
  html_report = "#{Kettle::Soup::Cover::COVERAGE_DIR}/index.html"
13
15
  if Kettle::Soup::Cover::OPEN_BIN.empty?
14
16
  puts "Kettle::Soup::Cover::OPEN_BIN not configured. Coverage report is at #{Kettle::Soup::Cover.display_path(html_report)}"
17
+ elsif !File.exist?(html_report)
18
+ puts "No coverage report found at #{Kettle::Soup::Cover.display_path(html_report)}"
15
19
  else
16
- begin
17
- %x(#{Kettle::Soup::Cover::OPEN_BIN} #{html_report})
18
- rescue Errno::ENOENT => error
19
- message = error.message || ""
20
- # `open` command is macOS only. xdg-open is a decent alternative on many Linux systems.
21
- if message.include?("No such file or directory - #{Kettle::Soup::Cover::OPEN_BIN}")
22
- puts "Configured Kettle::Soup::Cover::OPEN_BIN (#{Kettle::Soup::Cover::OPEN_BIN}) not available. Coverage report is at #{Kettle::Soup::Cover.display_path(html_report)}"
23
- elsif message.include?("No such file or directory")
24
- puts "No coverage report found at #{Kettle::Soup::Cover.display_path(html_report)}"
25
- puts message
26
- else
27
- raise error
28
- end
20
+ open_command = Shellwords.split(Kettle::Soup::Cover::OPEN_BIN)
21
+ opened = system(*open_command, html_report)
22
+ unless opened
23
+ puts "Configured Kettle::Soup::Cover::OPEN_BIN (#{Kettle::Soup::Cover::OPEN_BIN}) not available. Coverage report is at #{Kettle::Soup::Cover.display_path(html_report)}"
29
24
  end
30
25
  end
31
26
  end
@@ -4,7 +4,7 @@ module Kettle
4
4
  module Soup
5
5
  module Cover
6
6
  module Version
7
- VERSION = "1.1.2"
7
+ VERSION = "1.1.3"
8
8
  end
9
9
  VERSION = Version::VERSION # Traditional Constant Location
10
10
  end
@@ -16,6 +16,7 @@
16
16
 
17
17
  # Standard Lib
18
18
  require "fileutils"
19
+ require "json"
19
20
  require "rbconfig"
20
21
 
21
22
  # External gems
@@ -83,6 +84,10 @@ module Kettle
83
84
  Dir[File.join(turbo_tests_coverage_dir(coverage_dir, project_root: project_root), "*", ".resultset.json")]
84
85
  end
85
86
 
87
+ def turbo_tests_json_paths(coverage_dir = Constants::COVERAGE_ROOT_DIR, project_root: Dir.pwd)
88
+ Dir[File.join(turbo_tests_coverage_dir(coverage_dir, project_root: project_root), "*", "coverage.json")]
89
+ end
90
+
86
91
  def collate_turbo_tests_coverage!(coverage_dir = Constants::COVERAGE_ROOT_DIR, project_root: Dir.pwd)
87
92
  return :disabled unless turbo_tests_coverage?
88
93
 
@@ -113,9 +118,69 @@ module Kettle
113
118
  end
114
119
  end
115
120
 
121
+ publish_turbo_tests_json_coverage!(coverage_dir, project_root: project_root)
122
+
116
123
  :collated
117
124
  end
118
125
 
126
+ def publish_turbo_tests_json_coverage!(coverage_dir = Constants::COVERAGE_ROOT_DIR, project_root: Dir.pwd)
127
+ paths = turbo_tests_json_paths(coverage_dir, project_root: project_root)
128
+ return :empty if paths.empty?
129
+
130
+ merged = {
131
+ "meta" => {},
132
+ "coverage" => {},
133
+ }
134
+ paths.sort_by { |path| File.basename(File.dirname(path)).to_i }.each do |path|
135
+ data = JSON.parse(File.read(path))
136
+ merged["meta"].merge!(data["meta"]) if data["meta"].is_a?(Hash)
137
+ merge_json_coverage!(merged["coverage"], data["coverage"] || {})
138
+ end
139
+
140
+ output_path = File.expand_path(File.join(coverage_dir, "coverage.json"), project_root)
141
+ FileUtils.mkdir_p(File.dirname(output_path))
142
+ File.write(output_path, JSON.pretty_generate(merged))
143
+ :published
144
+ end
145
+
146
+ def merge_json_coverage!(target, source)
147
+ source.each do |path, coverage|
148
+ target[path] ||= {"lines" => [], "branches" => []}
149
+ target[path]["lines"] = merge_line_coverage(target[path]["lines"], coverage["lines"] || [])
150
+ target[path]["branches"] = merge_branch_coverage(target[path]["branches"] || [], coverage["branches"] || [])
151
+ end
152
+ target
153
+ end
154
+
155
+ def merge_line_coverage(left, right)
156
+ length = [left.length, right.length].max
157
+ Array.new(length) { |index| merge_coverage_value(left[index], right[index]) }
158
+ end
159
+
160
+ def merge_branch_coverage(left, right)
161
+ length = [left.length, right.length].max
162
+ Array.new(length) { |index| merge_branch_entry(left[index], right[index]) }.compact
163
+ end
164
+
165
+ def merge_branch_entry(left, right)
166
+ return right unless left
167
+ return left unless right
168
+ return left unless left.is_a?(Hash) && right.is_a?(Hash)
169
+
170
+ left.merge(right) do |key, left_value, right_value|
171
+ (key == "coverage") ? merge_coverage_value(left_value, right_value) : left_value
172
+ end
173
+ end
174
+
175
+ def merge_coverage_value(left, right)
176
+ return left + right if left.is_a?(Integer) && right.is_a?(Integer)
177
+ return left if left.is_a?(Integer)
178
+ return right if right.is_a?(Integer)
179
+ return left if left
180
+
181
+ right
182
+ end
183
+
119
184
  def coverage_task_env(coverage_dir = Constants::COVERAGE_DIR, project_root: Dir.pwd)
120
185
  resolved_coverage_dir = File.expand_path(coverage_dir, project_root)
121
186
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-soup-cover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -385,10 +385,10 @@ licenses:
385
385
  - AGPL-3.0-only
386
386
  metadata:
387
387
  homepage_uri: https://kettle-soup-cover.galtzo.com/
388
- source_code_uri: https://github.com/kettle-rb/kettle-soup-cover/tree/v1.1.2
389
- changelog_uri: https://github.com/kettle-rb/kettle-soup-cover/blob/v1.1.2/CHANGELOG.md
388
+ source_code_uri: https://github.com/kettle-rb/kettle-soup-cover/tree/v1.1.3
389
+ changelog_uri: https://github.com/kettle-rb/kettle-soup-cover/blob/v1.1.3/CHANGELOG.md
390
390
  bug_tracker_uri: https://github.com/kettle-rb/kettle-soup-cover/issues
391
- documentation_uri: https://www.rubydoc.info/gems/kettle-soup-cover/1.1.2
391
+ documentation_uri: https://www.rubydoc.info/gems/kettle-soup-cover/1.1.3
392
392
  funding_uri: https://github.com/sponsors/pboling
393
393
  wiki_uri: https://github.com/kettle-rb/kettle-soup-cover/wiki
394
394
  news_uri: https://www.railsbling.com/tags/kettle-soup-cover
@@ -418,7 +418,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
418
418
  - !ruby/object:Gem::Version
419
419
  version: '0'
420
420
  requirements: []
421
- rubygems_version: 4.0.11
421
+ rubygems_version: 4.0.10
422
422
  specification_version: 4
423
423
  summary: "\U0001F958 kettle-rb OOTB SimpleCov config supporting every CI platform
424
424
  & coverage tool"
metadata.gz.sig CHANGED
Binary file