kettle-rb 0.1.17 → 0.1.19

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: d3a67dee10c54ea715bd24c351409646fcc8b2f878e3eda3b5187f4380840bf8
4
- data.tar.gz: 8e8007ca4447fdc5d52020aadf39bb2acc9b15c68a62641575f28652ec39f557
3
+ metadata.gz: 532e7b6770fe7e4c6dcbce18352bcbc06ed6d43462ece10d0a20d15c9093c566
4
+ data.tar.gz: 406004885a541a391999c6b6d1caff63053179a60888ccba403fa88a3865c47d
5
5
  SHA512:
6
- metadata.gz: 8e2a12df501f74a1df78cd89fe41c6351c0277277b200aa6d28bd50bca3e6e5a5bb91e784f654f902efd16f6b0d659f87a59980386c01bc9adbfb51f808fb8cf
7
- data.tar.gz: 183398084b775b5fb1ccc58fd78b5aa549fb052b1dce814fd3f2dcb6187bce242868959d80768baf49c7c1434122b0675e3d9696e1cdae5c890149bfe9d8dbd7
6
+ metadata.gz: be65287dc3db21c5f2289b71bb574ef3c385937cdb0c5badeea3fae7ec64ea2a9694e29d2eaf3cc3dd2643a8a5692be4bb28892f39759576d61bf7b4c1ee68f3
7
+ data.tar.gz: aa44e941528f17fd19dd163e50d84f9e0775b25dc8a686c39ec7cfeab2587ee6ca511b9db254f3d1496e4eabd9ad99550b1a16f48b769273fb1469c1d37cae31
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,48 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.1.19] - 2026-10-25
34
+
35
+ - TAG: [v0.1.19][0.1.19t]
36
+ - COVERAGE: 100.00% -- 421/421 lines in 11 files
37
+ - BRANCH COVERAGE: 98.15% -- 53/54 branches in 11 files
38
+ - 63.08% documented
39
+
40
+ ### Added
41
+
42
+ - Shared Ruby series bucket range calculation for compatibility matrices and template curation.
43
+
44
+ ### Changed
45
+
46
+ - [kc] kettle-jem/prepare: updated 25 project files:
47
+ - dependencies (25)
48
+
49
+ - [kc] kettle-jem/template: updated 13 project files:
50
+ - code and tests (2)
51
+ - dependencies (2)
52
+ - documentation (1)
53
+ - other (1)
54
+ - workflows (7)
55
+
56
+ ## [0.1.18] - 2026-10-15
57
+
58
+ - TAG: [v0.1.18][0.1.18t]
59
+ - COVERAGE: 100.00% -- 362/362 lines in 10 files
60
+ - BRANCH COVERAGE: 97.62% -- 41/42 branches in 10 files
61
+ - 61.90% documented
62
+
63
+ ### Changed
64
+
65
+ - [kc] kettle-jem/prepare: updated 19 project files:
66
+ - configuration (1)
67
+ - dependencies (18)
68
+
69
+ - [kc] kettle-jem/template: updated 33 project files:
70
+ - code and tests (2)
71
+ - documentation (1)
72
+ - other (1)
73
+ - workflows (29)
74
+
33
75
  ## [0.1.17] - 2026-10-10
34
76
 
35
77
  - TAG: [v0.1.17][0.1.17t]
@@ -363,7 +405,11 @@ Please file a bug if you notice a violation of semantic versioning.
363
405
  - Add `Kettle::Rb::CompatMatrix` as the shared Ruby, engine, Rails, RuboCop,
364
406
  and RuboCop LTS compatibility source of truth for kettle-dev tooling.
365
407
 
366
- [Unreleased]: https://github.com/kettle-dev/kettle-rb/compare/v0.1.17...HEAD
408
+ [Unreleased]: https://github.com/kettle-dev/kettle-rb/compare/v0.1.19...HEAD
409
+ [0.1.19]: https://github.com/kettle-dev/kettle-rb/compare/v0.1.18...v0.1.19
410
+ [0.1.19t]: https://github.com/kettle-dev/kettle-rb/releases/tag/v0.1.19
411
+ [0.1.18]: https://github.com/kettle-dev/kettle-rb/compare/v0.1.17...v0.1.18
412
+ [0.1.18t]: https://github.com/kettle-dev/kettle-rb/releases/tag/v0.1.18
367
413
  [0.1.17]: https://github.com/kettle-dev/kettle-rb/compare/v0.1.15...v0.1.17
368
414
  [0.1.17t]: https://github.com/kettle-dev/kettle-rb/releases/tag/v0.1.17
369
415
  [0.1.15]: https://github.com/kettle-dev/kettle-rb/compare/v0.1.14...v0.1.15
data/README.md CHANGED
@@ -21,7 +21,7 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
21
21
 
22
22
  ## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
23
23
 
24
- `kettle-dev` is the small shared Ruby library for the kettle-dev toolchain.
24
+ `kettle-rb` is the small shared Ruby library for the kettle-dev toolchain.
25
25
 
26
26
  Its first public responsibility is `Kettle::Rb::CompatMatrix`: a single source
27
27
  of truth for Ruby engine compatibility data used by `kettle-jem`,
@@ -29,19 +29,34 @@ of truth for Ruby engine compatibility data used by `kettle-jem`,
29
29
  JRuby, and TruffleRuby versions, workflow Ruby buckets, RubyGems/Bundler
30
30
  policy, Rails appraisal hints, and RuboCop LTS selection data.
31
31
 
32
+ Its second public responsibility is `Kettle::Rb::PlatformSupport`: the
33
+ evidenced source of truth for OS-platform support claims. It names CI OS
34
+ families (`linux`, `macos`, `windows` — a fourth platform vocabulary, distinct
35
+ from Gemfile DSL platform symbols, `Gem::Platform` strings, and GitHub runner
36
+ labels), maps each family to a runner label, and records per-engine OS
37
+ support where every claim carries a citation. Data is regenerated from the
38
+ GitHub releases API and `ruby/setup-ruby` with
39
+ `rake kettle:rb:platform_support:generate`; unknown engine/OS pairs resolve
40
+ as unsupported so a missing claim can never invent CI coverage. These values
41
+ select runner labels only — they must never be passed to
42
+ `bundle lock --add-platform` or a Gemfile `platforms:` DSL without
43
+ translation.
44
+
32
45
  Use it when tooling needs to answer questions like:
33
46
 
34
47
  - Which Ruby workflow should represent this engine?
35
48
  - Which RuboCop LTS family matches a minimum supported Ruby?
36
49
  - Which `rubocop-rubyN_N` gem and rubocop-lts branch belong together?
37
50
  - Which Rails appraisal version is the newest stable target for a Ruby bucket?
51
+ - Which GitHub runner label does a CI OS family select, and which engines
52
+ are supported on that OS?
38
53
 
39
54
  ## 💡 Info you can shake a stick at
40
55
 
41
56
  | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
42
57
  |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
43
58
  | Works with JRuby | [![JRuby 9.2 Compat][💎jruby-9.2i]][🚎jruby-9.2-wf] [![JRuby 9.3 Compat][💎jruby-9.3i]][🚎jruby-9.3-wf] <br/> [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎jruby-9.4-wf] [![JRuby 10.0 Compat][💎jruby-10.0i]][🚎jruby-10.0-wf] [![JRuby current Compat][💎jruby-c-i]][🚎10-j-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf]|
44
- | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎truby-22.3-wf] [![Truffle Ruby 23.0 Compat][💎truby-23.0i]][🚎truby-23.0-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎truby-23.1-wf] <br/> [![Truffle Ruby 24.2 Compat][💎truby-24.2i]][🚎truby-24.2-wf] [![Truffle Ruby 25.0 Compat][💎truby-25.0i]][🚎truby-25.0-wf] [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf] [![Truffle Ruby HEAD Compat][💎truby-headi]][🚎3-hd-wf]|
59
+ | Works with Truffle Ruby | [![Truffle Ruby 22.3 Compat][💎truby-22.3i]][🚎truby-22.3-wf] [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎truby-23.1-wf] <br/> [![Truffle Ruby 24.2 Compat][💎truby-24.2i]][🚎truby-24.2-wf] [![Truffle Ruby 25.0 Compat][💎truby-25.0i]][🚎truby-25.0-wf] [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf]|
45
60
  | Works with MRI Ruby 4 | [![Ruby current Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf]|
46
61
  | Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎ruby-3.0-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎ruby-3.1-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎ruby-3.2-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎ruby-3.3-wf] [![Ruby 3.4 Compat][💎ruby-3.4i]][🚎ruby-3.4-wf]|
47
62
  | Works with MRI Ruby 2 | ![Ruby 2.0 Compat][💎ruby-2.0i] ![Ruby 2.1 Compat][💎ruby-2.1i] ![Ruby 2.2 Compat][💎ruby-2.2i] ![Ruby 2.3 Compat][💎ruby-2.3i] <br/> [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎ruby-2.4-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎ruby-2.5-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎ruby-2.6-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎ruby-2.7-wf]|
@@ -58,6 +73,7 @@ Use it when tooling needs to answer questions like:
58
73
 
59
74
  Compatible with MRI Ruby 1.8.7+, JRuby, and TruffleRuby.
60
75
  CI workflows and Appraisals are generated for MRI Ruby 2.4.0+.
76
+ The current MRI CI lane runs on Linux and macOS.
61
77
  This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
62
78
  may be higher than the gem's runtime compatibility floor when legacy Rubies are
63
79
  not practical for the current toolchain.
@@ -97,29 +113,12 @@ The _amazing_ test matrix is powered by the kettle-dev stack.
97
113
 
98
114
  ### Enterprise Support
99
115
 
100
- [![Tidelift](https://tidelift.com/badges/package/rubygems/kettle-rb)](https://tidelift.com/subscription/pkg/rubygems-kettle-rb?utm_source=rubygems-kettle-rb&utm_medium=referral&utm_campaign=readme)
101
-
102
- Available as part of the Tidelift Subscription.
103
-
104
- <details markdown="1">
105
- <summary>Need enterprise-level guarantees?</summary>
106
-
107
- The maintainers of this and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.
108
-
109
- [![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift]
116
+ For enterprise support from the maintainer, use [Upwork][👨🏼‍🏫expsup-upwork] or [CodeMentor][👨🏼‍🏫expsup-codementor].
110
117
 
111
- - 💡Subscribe for support guarantees covering _all_ your FLOSS dependencies
112
- - 💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar]
113
- - 💡Tidelift pays maintainers to maintain the software you depend on!<br/>📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers
114
-
115
- Alternatively:
118
+ Other support channels:
116
119
 
117
120
  - [![Ruby Users Forum][✉️ruby-forum-img]][✉️ruby-forum]
118
121
  - [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
119
- - [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork]
120
- - [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor]
121
-
122
- </details>
123
122
 
124
123
  ## ✨ Installation
125
124
 
@@ -190,6 +189,52 @@ Kettle::Rb::CompatMatrix.rubocop_lts_branch_for_gem("rubocop-ruby3_2")
190
189
  # => "r3_2-even-v24"
191
190
  ```
192
191
 
192
+ Map a CI OS family to its GitHub runner label:
193
+
194
+ ```ruby
195
+ Kettle::Rb::PlatformSupport.os_family?("macos")
196
+ # => true
197
+
198
+ Kettle::Rb::PlatformSupport.os_family?("x86_64-linux")
199
+ # => false -- that is a Gem::Platform string, not a CI OS family
200
+
201
+ Kettle::Rb::PlatformSupport.runner_label("windows")
202
+ # => "windows-latest"
203
+
204
+ Kettle::Rb::PlatformSupport.runner_label("plan9")
205
+ # => nil
206
+ ```
207
+
208
+ Check engine support per OS family (fail-closed: unknown pairs are
209
+ unsupported, never assumed covered):
210
+
211
+ ```ruby
212
+ Kettle::Rb::PlatformSupport.engine_supports_os?("truffleruby", "windows")
213
+ # => false -- no Windows build has ever shipped (66 releases scanned)
214
+
215
+ Kettle::Rb::PlatformSupport.engine_supports_os?("jruby", "linux")
216
+ # => true
217
+
218
+ Kettle::Rb::PlatformSupport.supported_os_families("jruby")
219
+ # => ["linux", "macos", "windows"]
220
+
221
+ Kettle::Rb::PlatformSupport.supported_engines("linux")
222
+ # => ["ruby", "jruby", "truffleruby"]
223
+
224
+ entry = Kettle::Rb::PlatformSupport.engine_os_entry("truffleruby", "macos")
225
+ entry.support # => "supported"
226
+ entry.note # => "darwin-aarch64 since 22.2.0; macOS Intel removed in 34.0, ..."
227
+ entry.citation # => "https://github.com/truffleruby/truffleruby/releases/tag/graal-34.0.0"
228
+ ```
229
+
230
+ Every entry carries its evidence. Regenerate the data table from live
231
+ sources (GitHub releases API, `ruby/setup-ruby`) when a platform claim
232
+ changes:
233
+
234
+ ```console
235
+ bundle exec rake kettle:rb:platform_support:generate
236
+ ```
237
+
193
238
  ## 🦷 FLOSS Funding
194
239
 
195
240
  While kettle-dev tools are free software and will always be, the project would benefit immensely from some funding.
@@ -199,19 +244,18 @@ We welcome both individual and corporate sponsors! We also offer a
199
244
  wide array of funding channels to account for your preferences.
200
245
  Currently, [Open Collective][🖇osc] is our preferred funding platform.
201
246
 
247
+ ### Corporate Sponsorship
248
+
202
249
  **If you're working in a company that's making significant use of kettle-dev tools we'd
203
250
  appreciate it if you suggest to your company to become a kettle-dev sponsor.**
204
251
 
252
+ ### Individual Support
253
+
205
254
  You can support the development of kettle-dev tools via
206
255
  [GitHub Sponsors][🖇sponsor],
207
256
  [Liberapay][⛳liberapay],
208
- [PayPal][🖇paypal],
209
- [Open Collective][🖇osc]
210
- and [Tidelift][🏙️entsup-tidelift].
211
-
212
- | 📍 NOTE |
213
- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
214
- | If doing a sponsorship in the form of donation is problematic for your company <br/> from an accounting standpoint, we'd recommend the use of Tidelift, <br/> where you can get a support-like subscription instead. |
257
+ [Open Collective][🖇osc],
258
+ and [PayPal][🖇paypal].
215
259
 
216
260
  ### Open Collective for Individuals
217
261
 
@@ -426,9 +470,6 @@ Thanks for RTFM. ☺️
426
470
  [👨🏼‍🏫expsup-upwork-img]: https://img.shields.io/badge/UpWork-13544E?style=for-the-badge&logo=Upwork&logoColor=white
427
471
  [👨🏼‍🏫expsup-codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
428
472
  [👨🏼‍🏫expsup-codementor-img]: https://img.shields.io/badge/CodeMentor-Get_Help-1abc9c?style=for-the-badge&logo=CodeMentor&logoColor=white
429
- [🏙️entsup-tidelift]: https://tidelift.com/subscription/pkg/rubygems-kettle-rb?utm_source=rubygems-kettle-rb&utm_medium=referral&utm_campaign=readme
430
- [🏙️entsup-tidelift-img]: https://img.shields.io/badge/Tidelift_and_Sonar-Enterprise_Support-FD3456?style=for-the-badge&logo=sonar&logoColor=white
431
- [🏙️entsup-tidelift-sonar]: https://blog.tidelift.com/tidelift-joins-sonar
432
473
  [💁🏼‍♂️peterboling]: http://www.peterboling.com
433
474
  [🚂railsbling]: http://www.railsbling.com
434
475
  [📜src-gl-img]: https://img.shields.io/badge/GitLab-FBA326?style=for-the-badge&logo=Gitlab&logoColor=orange
@@ -469,7 +510,6 @@ Thanks for RTFM. ☺️
469
510
  [🚎jruby-9.4-wf]: https://github.com/kettle-dev/kettle-rb/actions/workflows/jruby-9.4.yml
470
511
  [🚎jruby-10.0-wf]: https://github.com/kettle-dev/kettle-rb/actions/workflows/jruby-10.0.yml
471
512
  [🚎truby-22.3-wf]: https://github.com/kettle-dev/kettle-rb/actions/workflows/truffleruby-22.3.yml
472
- [🚎truby-23.0-wf]: https://github.com/kettle-dev/kettle-rb/actions/workflows/truffleruby-23.0.yml
473
513
  [🚎truby-23.1-wf]: https://github.com/kettle-dev/kettle-rb/actions/workflows/truffleruby-23.1.yml
474
514
  [🚎truby-24.2-wf]: https://github.com/kettle-dev/kettle-rb/actions/workflows/truffleruby-24.2.yml
475
515
  [🚎truby-25.0-wf]: https://github.com/kettle-dev/kettle-rb/actions/workflows/truffleruby-25.0.yml
@@ -512,13 +552,11 @@ Thanks for RTFM. ☺️
512
552
  [💎ruby-c-i]: https://img.shields.io/badge/Ruby-current-CC342D?style=for-the-badge&logo=ruby&logoColor=green
513
553
  [💎ruby-headi]: https://img.shields.io/badge/Ruby-HEAD-CC342D?style=for-the-badge&logo=ruby&logoColor=blue
514
554
  [💎truby-22.3i]: https://img.shields.io/badge/Truffle_Ruby-22.3-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
515
- [💎truby-23.0i]: https://img.shields.io/badge/Truffle_Ruby-23.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
516
555
  [💎truby-23.1i]: https://img.shields.io/badge/Truffle_Ruby-23.1-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
517
556
  [💎truby-24.2i]: https://img.shields.io/badge/Truffle_Ruby-24.2-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
518
557
  [💎truby-25.0i]: https://img.shields.io/badge/Truffle_Ruby-25.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
519
558
  [💎truby-33.0i]: https://img.shields.io/badge/Truffle_Ruby-33.0-34BCB1?style=for-the-badge&logo=ruby&logoColor=pink
520
559
  [💎truby-c-i]: https://img.shields.io/badge/Truffle_Ruby-current-34BCB1?style=for-the-badge&logo=ruby&logoColor=green
521
- [💎truby-headi]: https://img.shields.io/badge/Truffle_Ruby-HEAD-34BCB1?style=for-the-badge&logo=ruby&logoColor=blue
522
560
  [💎jruby-9.2i]: https://img.shields.io/badge/JRuby-9.2-FBE742?style=for-the-badge&logo=ruby&logoColor=red
523
561
  [💎jruby-9.3i]: https://img.shields.io/badge/JRuby-9.3-FBE742?style=for-the-badge&logo=ruby&logoColor=red
524
562
  [💎jruby-9.4i]: https://img.shields.io/badge/JRuby-9.4-FBE742?style=for-the-badge&logo=ruby&logoColor=red
@@ -551,7 +589,7 @@ Thanks for RTFM. ☺️
551
589
  [📌gitmoji]: https://gitmoji.dev
552
590
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
553
591
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
554
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.362-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
592
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.421-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
555
593
  [🔐security]: https://github.com/kettle-dev/kettle-rb/blob/main/SECURITY.md
556
594
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
557
595
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -581,5 +619,5 @@ Thanks for RTFM. ☺️
581
619
  | Homepage | https://github.com/kettle-dev/kettle-rb |
582
620
  | Source | https://github.com/kettle-dev/kettle-rb |
583
621
  | License | `MIT` |
584
- | Funding | https://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-dev, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/kettle-rb, https://www.buymeacoffee.com/pboling |
622
+ | Funding | https://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-dev, https://thanks.dev/u/gh/pboling, https://www.buymeacoffee.com/pboling |
585
623
  <!-- kettle-jem:metadata:end -->
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubygems"
4
+ require "set"
5
+ require "kettle/rb/compat_matrix"
6
+
7
+ module Kettle
8
+ module Rb
9
+ # Converts between Ruby minor-version seams and the folder buckets used by
10
+ # modular Gemfile matrices. A major-only bucket (rN) is the catch-all for
11
+ # the newest range in that major; rN.M buckets cover the earlier range
12
+ # ending at M.
13
+ module RubySeriesBuckets
14
+ module_function
15
+
16
+ # Builds buckets and their Ruby ranges from the seam versions that define
17
+ # the matrix. This is the shared implementation used by appraisal matrix
18
+ # generation and by template curation.
19
+ #
20
+ # @param minor_versions [Array<String, Gem::Version>]
21
+ # @return [Hash] bucket names and floor/ceiling ranges
22
+ def from_minor_versions(minor_versions)
23
+ by_major = Array(minor_versions).each_with_object({}) do |minor, grouped|
24
+ version = Gem::Version.new(minor.to_s)
25
+ major = version.segments[0]
26
+ grouped[major] ||= []
27
+ grouped[major] << version
28
+ end
29
+
30
+ buckets = []
31
+ ranges = {}
32
+ by_major.each do |major, versions|
33
+ sorted = versions.uniq.sort
34
+ sorted.each_with_index do |version, index|
35
+ if index == sorted.length - 1
36
+ bucket = "r#{major}"
37
+ buckets << bucket
38
+ ranges[bucket] = {:floor => version, :ceiling => Gem::Version.new("#{major}.99")}
39
+ next
40
+ end
41
+
42
+ next_version = sorted[index + 1]
43
+ upper = [next_version.segments[1].to_i - 1, version.segments[1].to_i].max
44
+ bucket = "r#{major}.#{upper}"
45
+ buckets << bucket
46
+ ranges[bucket] = {
47
+ :floor => version,
48
+ :ceiling => Gem::Version.new("#{major}.#{upper}")
49
+ }
50
+ end
51
+ end
52
+
53
+ {:buckets => buckets.uniq, :bucket_ranges => ranges}
54
+ end
55
+
56
+ # Reconstructs the canonical ranges from the complete set of bucket
57
+ # folder names. Named buckets are upper bounds; the major-only bucket
58
+ # catches the remaining versions in that major.
59
+ #
60
+ # @param buckets [Array<String>] folder names such as r2.4, r2.6, r2
61
+ # @return [Hash{String => Hash}] ranges keyed by bucket name
62
+ def ranges_for_buckets(buckets)
63
+ parsed = Array(buckets).map { |bucket|
64
+ match = bucket.to_s.match(/\Ar(\d+)(?:\.(\d+))?\z/)
65
+ [match[1].to_i, match[2] && match[2].to_i, bucket.to_s] if match
66
+ }.compact
67
+ parsed.group_by(&:first).each_with_object({}) do |(major, entries), result|
68
+ named = entries.select { |_major, minor, _bucket| minor }.sort_by { |_major, minor, _bucket| minor }
69
+ seams = [minimum_ruby_for_major(major)]
70
+ named.each do |_entry_major, minor, _bucket|
71
+ seams << Gem::Version.new("#{major}.#{minor + 1}")
72
+ end
73
+ seams.uniq!
74
+ generated = from_minor_versions(seams)
75
+ requested = entries.map(&:last).to_set
76
+ generated.fetch(:bucket_ranges).each do |bucket, range|
77
+ result[bucket] = range if requested.include?(bucket)
78
+ end
79
+ end
80
+ end
81
+
82
+ # Keeps every bucket whose Ruby range intersects the destination's
83
+ # supported Ruby versions (all versions at or above +:minimum+).
84
+ # Takes an options hash rather than a required keyword so the file parses
85
+ # on every Ruby the gem supports.
86
+ def relevant_buckets(buckets, options = {})
87
+ floor = Gem::Version.new(options.fetch(:minimum).to_s)
88
+ ranges = ranges_for_buckets(buckets)
89
+ ranges.map { |bucket, range| bucket if range.fetch(:ceiling) >= floor }
90
+ .compact
91
+ .sort_by { |bucket| bucket_sort_key(bucket) }
92
+ end
93
+
94
+ def minimum_ruby_for_major(major)
95
+ versions = CompatMatrix.entries.map { |key, _entry|
96
+ match = key.match(/\Aruby-(\d+)\.(\d+)\z/)
97
+ Gem::Version.new("#{match[1]}.#{match[2]}") if match && match[1].to_i == major
98
+ }.compact
99
+ versions.min || Gem::Version.new("#{major}.0")
100
+ end
101
+ private_class_method :minimum_ruby_for_major
102
+
103
+ def bucket_sort_key(bucket)
104
+ match = bucket.match(/\Ar(\d+)(?:\.(\d+))?\z/)
105
+ [match[1].to_i, match[2] ? match[2].to_i : 999]
106
+ end
107
+ private_class_method :bucket_sort_key
108
+ end
109
+ end
110
+ end
@@ -5,7 +5,7 @@ module Kettle
5
5
  # Version namespace for this gem.
6
6
  module Version
7
7
  # Current gem version.
8
- VERSION = "0.1.17"
8
+ VERSION = "0.1.19"
9
9
  end
10
10
  # Current gem version exposed at the traditional constant location.
11
11
  VERSION = Version::VERSION # Traditional Constant Location
data/lib/kettle/rb.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "rb/compat_matrix"
4
+ require_relative "rb/ruby_series_buckets"
4
5
  require_relative "rb/gem_floors"
5
6
  require_relative "rb/gem_dependencies"
6
7
  require_relative "rb/platform_support"
data/sig/kettle/rb.rbs CHANGED
@@ -5,5 +5,11 @@ module Kettle
5
5
  VERSION: String
6
6
  end
7
7
  VERSION: String
8
+
9
+ module RubySeriesBuckets
10
+ def self.from_minor_versions: (Array[String | Gem::Version]) -> { buckets: Array[String], bucket_ranges: Hash[String, { floor: Gem::Version, ceiling: Gem::Version }] }
11
+ def self.ranges_for_buckets: (Array[String]) -> Hash[String, { floor: Gem::Version, ceiling: Gem::Version }]
12
+ def self.relevant_buckets: (Array[String], minimum: String | Gem::Version) -> Array[String]
13
+ end
8
14
  end
9
15
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '3.1'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 3.1.9
49
+ version: 3.1.24
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,7 +56,7 @@ dependencies:
56
56
  version: '3.1'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 3.1.9
59
+ version: 3.1.24
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: bundler-audit
62
62
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  version: '0.1'
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.3
117
+ version: 0.1.4
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -124,7 +124,7 @@ dependencies:
124
124
  version: '0.1'
125
125
  - - ">="
126
126
  - !ruby/object:Gem::Version
127
- version: 0.1.3
127
+ version: 0.1.4
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: appraisal2
130
130
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +134,7 @@ dependencies:
134
134
  version: '3.2'
135
135
  - - ">="
136
136
  - !ruby/object:Gem::Version
137
- version: 3.2.5
137
+ version: 3.2.6
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ dependencies:
144
144
  version: '3.2'
145
145
  - - ">="
146
146
  - !ruby/object:Gem::Version
147
- version: 3.2.5
147
+ version: 3.2.6
148
148
  - !ruby/object:Gem::Dependency
149
149
  name: kettle-test
150
150
  requirement: !ruby/object:Gem::Requirement
@@ -154,7 +154,7 @@ dependencies:
154
154
  version: '2.0'
155
155
  - - ">="
156
156
  - !ruby/object:Gem::Version
157
- version: 2.0.23
157
+ version: 2.0.27
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
@@ -164,27 +164,27 @@ dependencies:
164
164
  version: '2.0'
165
165
  - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 2.0.23
167
+ version: 2.0.27
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: turbo_tests2
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: '3.2'
174
+ version: '4.0'
175
175
  - - ">="
176
176
  - !ruby/object:Gem::Version
177
- version: 3.2.14
177
+ version: 4.0.0
178
178
  type: :development
179
179
  prerelease: false
180
180
  version_requirements: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - "~>"
183
183
  - !ruby/object:Gem::Version
184
- version: '3.2'
184
+ version: '4.0'
185
185
  - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: 3.2.14
187
+ version: 4.0.0
188
188
  - !ruby/object:Gem::Dependency
189
189
  name: ruby-progressbar
190
190
  requirement: !ruby/object:Gem::Requirement
@@ -259,6 +259,7 @@ files:
259
259
  - lib/kettle/rb/platform_support.rb
260
260
  - lib/kettle/rb/platform_support/data.rb
261
261
  - lib/kettle/rb/platform_support/generator.rb
262
+ - lib/kettle/rb/ruby_series_buckets.rb
262
263
  - lib/kettle/rb/version.rb
263
264
  - sig/kettle/rb.rbs
264
265
  homepage: https://github.com/kettle-dev/kettle-rb
@@ -266,10 +267,10 @@ licenses:
266
267
  - MIT
267
268
  metadata:
268
269
  homepage_uri: https://kettle-rb.galtzo.com
269
- source_code_uri: https://github.com/kettle-dev/kettle-rb/tree/v0.1.17
270
- changelog_uri: https://github.com/kettle-dev/kettle-rb/blob/v0.1.17/CHANGELOG.md
270
+ source_code_uri: https://github.com/kettle-dev/kettle-rb/tree/v0.1.19
271
+ changelog_uri: https://github.com/kettle-dev/kettle-rb/blob/v0.1.19/CHANGELOG.md
271
272
  bug_tracker_uri: https://github.com/kettle-dev/kettle-rb/issues
272
- documentation_uri: https://www.rubydoc.info/gems/kettle-rb/0.1.17
273
+ documentation_uri: https://www.rubydoc.info/gems/kettle-rb/0.1.19
273
274
  funding_uri: https://github.com/sponsors/pboling
274
275
  wiki_uri: https://github.com/kettle-dev/kettle-rb/wiki
275
276
  news_uri: https://www.railsbling.com/tags/kettle-rb
metadata.gz.sig CHANGED
Binary file