kettle-dev 1.1.19 โ 1.1.21
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ancient.yml +5 -0
- data/.github/workflows/ancient.yml.example +5 -0
- data/.github/workflows/coverage.yml +5 -0
- data/.github/workflows/coverage.yml.example +5 -0
- data/.github/workflows/current.yml +5 -0
- data/.github/workflows/dep-heads.yml +5 -0
- data/.github/workflows/heads.yml +5 -0
- data/.github/workflows/heads.yml.example +5 -0
- data/.github/workflows/jruby.yml +5 -0
- data/.github/workflows/jruby.yml.example +5 -0
- data/.github/workflows/legacy.yml +5 -0
- data/.github/workflows/license-eye.yml +5 -0
- data/.github/workflows/locked_deps.yml +5 -0
- data/.github/workflows/style.yml +5 -0
- data/.github/workflows/supported.yml +5 -0
- data/.github/workflows/truffle.yml +5 -0
- data/.github/workflows/unlocked_deps.yml +5 -0
- data/.github/workflows/unsupported.yml +5 -0
- data/.licenserc.yaml +7 -0
- data/CHANGELOG.md +275 -6
- data/README.md +25 -20
- data/README.md.example +35 -33
- data/Rakefile.example +1 -1
- data/exe/kettle-dev-setup +1 -0
- data/lib/kettle/dev/changelog_cli.rb +80 -3
- data/lib/kettle/dev/gem_spec_reader.rb +14 -8
- data/lib/kettle/dev/readme_backers.rb +2 -2
- data/lib/kettle/dev/setup_cli.rb +1 -0
- data/lib/kettle/dev/tasks/template_task.rb +125 -2
- data/lib/kettle/dev/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +6 -5
- metadata.gz.sig +0 -0
- /data/.github/workflows/{discord-notifier.yml โ discord-notifier.yml.example} +0 -0
data/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
# ๐ฒ Kettle::Dev
|
11
11
|
|
12
|
-
[![Version][๐ฝversioni]][๐ฝversion] [![GitHub tag (latest SemVer)][โณ๏ธtag-img]][โณ๏ธtag] [![License: MIT][๐license-img]][๐license-ref] [![Downloads Rank][๐ฝdl-ranki]][๐ฝdl-rank] [![Open Source Helpers][๐ฝoss-helpi]][๐ฝoss-help] [![CodeCov Test Coverage][
|
12
|
+
[![Version][๐ฝversioni]][๐ฝversion] [![GitHub tag (latest SemVer)][โณ๏ธtag-img]][โณ๏ธtag] [![License: MIT][๐license-img]][๐license-ref] [![Downloads Rank][๐ฝdl-ranki]][๐ฝdl-rank] [![Open Source Helpers][๐ฝoss-helpi]][๐ฝoss-help] [![CodeCov Test Coverage][๐codecovi]][๐codecov] [![Coveralls Test Coverage][๐coveralls-img]][๐coveralls] [![QLTY Test Coverage][๐qlty-covi]][๐qlty-cov] [![QLTY Maintainability][๐qlty-mnti]][๐qlty-mnt] [![CI Heads][๐3-hd-wfi]][๐3-hd-wf] [![CI Runtime Dependencies @ HEAD][๐12-crh-wfi]][๐12-crh-wf] [![CI Current][๐11-c-wfi]][๐11-c-wf] [![CI Truffle Ruby][๐9-t-wfi]][๐9-t-wf] [![CI JRuby][๐10-j-wfi]][๐10-j-wf] [![Deps Locked][๐13-๐๏ธ-wfi]][๐13-๐๏ธ-wf] [![Deps Unlocked][๐14-๐๏ธ-wfi]][๐14-๐๏ธ-wf] [![CI Supported][๐6-s-wfi]][๐6-s-wf] [![CI Legacy][๐4-lg-wfi]][๐4-lg-wf] [![CI Unsupported][๐7-us-wfi]][๐7-us-wf] [![CI Ancient][๐1-an-wfi]][๐1-an-wf] [![CI Test Coverage][๐2-cov-wfi]][๐2-cov-wf] [![CI Style][๐5-st-wfi]][๐5-st-wf] [![CodeQL][๐codeQL-img]][๐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][๐15-๐ชช-wfi]][๐15-๐ชช-wf]
|
13
13
|
|
14
14
|
`if ci_badges.map(&:color).detect { it != "green"}` โ๏ธ [let me know][๐ผ๏ธgaltzo-discord], as I may have missed the [discord notification][๐ผ๏ธgaltzo-discord].
|
15
15
|
|
@@ -61,7 +61,7 @@ bin/kettle-release
|
|
61
61
|
| Works with MRI Ruby 2 | [![Ruby 2.3 Compat][๐ruby-2.3i]][๐1-an-wf] [![Ruby 2.4 Compat][๐ruby-2.4i]][๐1-an-wf] [![Ruby 2.5 Compat][๐ruby-2.5i]][๐1-an-wf] [![Ruby 2.6 Compat][๐ruby-2.6i]][๐7-us-wf] [![Ruby 2.7 Compat][๐ruby-2.7i]][๐7-us-wf] |
|
62
62
|
| Support & Community | [![Join Me on Daily.dev's RubyFriends][โ๏ธruby-friends-img]][โ๏ธruby-friends] [![Live Chat on Discord][โ๏ธdiscord-invite-img-ftb]][โ๏ธdiscord-invite] [![Get help from me on Upwork][๐จ๐ผโ๐ซexpsup-upwork-img]][๐จ๐ผโ๐ซexpsup-upwork] [![Get help from me on Codementor][๐จ๐ผโ๐ซexpsup-codementor-img]][๐จ๐ผโ๐ซexpsup-codementor] |
|
63
63
|
| Source | [![Source on GitLab.com][๐src-gl-img]][๐src-gl] [![Source on CodeBerg.org][๐src-cb-img]][๐src-cb] [![Source on Github.com][๐src-gh-img]][๐src-gh] [![The best SHA: dQw4w9WgXcQ!][๐งฎkloc-img]][๐งฎkloc] |
|
64
|
-
| Documentation | [![Current release on RubyDoc.info][๐docs-cr-rd-img]][๐yard-current] [![YARD on Galtzo.com][๐docs-head-rd-img]][๐yard-head] [![Maintainer Blog][๐maint-blog-img]][๐maint-blog] [![Wiki][๐wiki-img]][๐wiki] |
|
64
|
+
| Documentation | [![Current release on RubyDoc.info][๐docs-cr-rd-img]][๐yard-current] [![YARD on Galtzo.com][๐docs-head-rd-img]][๐yard-head] [![Maintainer Blog][๐maint-blog-img]][๐maint-blog] [![GitLab Wiki][๐gl-wiki-img]][๐gl-wiki] [![GitHub Wiki][๐gh-wiki-img]][๐gh-wiki] |
|
65
65
|
| Compliance | [![License: MIT][๐license-img]][๐license-ref] [![Compatible with Apache Software Projects: Verified by SkyWalking Eyes][๐license-compat-img]][๐license-compat] [![๐ilo-declaration-img]][๐ilo-declaration] [![Security Policy][๐security-img]][๐security] [![Contributor Covenant 2.1][๐ชconduct-img]][๐ชconduct] [![SemVer 2.0.0][๐semver-img]][๐semver] |
|
66
66
|
| Style | [![Enforced Code Style Linter][๐rlts-img]][๐rlts] [![Keep-A-Changelog 1.0.0][๐keep-changelog-img]][๐keep-changelog] [![Gitmoji Commits][๐gitmoji-img]][๐gitmoji] [![Compatibility appraised by: appraisal2][๐appraisal2-img]][๐appraisal2] |
|
67
67
|
| Maintainer ๐๏ธ | [![Follow Me on LinkedIn][๐๐linkedin-img]][๐๐linkedin] [![Follow Me on Ruby.Social][๐๐ruby-mast-img]][๐๐ruby-mast] [![Follow Me on Bluesky][๐๐ฆbluesky-img]][๐๐ฆbluesky] [![Contact Maintainer][๐maint-contact-img]][๐maint-contact] [![My technical writing][๐๐๐ผโโ๏ธdevto-img]][๐๐๐ผโโ๏ธdevto] |
|
@@ -78,13 +78,13 @@ Compatible with MRI Ruby 2.3+, and concordant releases of JRuby, and TruffleRuby
|
|
78
78
|
### Federated DVCS
|
79
79
|
|
80
80
|
<details>
|
81
|
-
<summary>Find this repo on
|
81
|
+
<summary>Find this repo on federated forges (Coming soon!)</summary>
|
82
82
|
|
83
83
|
| Federated [DVCS][๐d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI | Discussions |
|
84
84
|
|-------------------------------------------------|-----------------------------------------------------------------------|---------------------------|--------------------------|---------------------------|--------------------------|------------------------------|
|
85
|
-
| ๐งช [kettle-rb/kettle-dev on GitLab][๐src-gl] | The Truth | [๐][๐คgl-issues] | [๐][๐คgl-pulls] | [๐][๐wiki]
|
85
|
+
| ๐งช [kettle-rb/kettle-dev on GitLab][๐src-gl] | The Truth | [๐][๐คgl-issues] | [๐][๐คgl-pulls] | [๐][๐gl-wiki] | ๐ญ Tiny Matrix | โ |
|
86
86
|
| ๐ง [kettle-rb/kettle-dev on CodeBerg][๐src-cb] | An Ethical Mirror ([Donate][๐คcb-donate]) | [๐][๐คcb-issues] | [๐][๐คcb-pulls] | โ | โญ๏ธ No Matrix | โ |
|
87
|
-
| ๐ [kettle-rb/kettle-dev on GitHub][๐src-gh] | Another Mirror | [๐][๐คgh-issues] | [๐][๐คgh-pulls] |
|
87
|
+
| ๐ [kettle-rb/kettle-dev on GitHub][๐src-gh] | Another Mirror | [๐][๐คgh-issues] | [๐][๐คgh-pulls] | [๐][๐gh-wiki] | ๐ฏ Full Matrix | [๐][gh-discussions] |
|
88
88
|
| ๐ฎ๏ธ [Discord Server][โ๏ธdiscord-invite] | [![Live Chat on Discord][โ๏ธdiscord-invite-img-ftb]][โ๏ธdiscord-invite] | [Let's][โ๏ธdiscord-invite] | [talk][โ๏ธdiscord-invite] | [about][โ๏ธdiscord-invite] | [this][โ๏ธdiscord-invite] | [library!][โ๏ธdiscord-invite] |
|
89
89
|
|
90
90
|
</details>
|
@@ -241,10 +241,12 @@ Thatโs it. Once installed, kettle-dev:
|
|
241
241
|
- option: force: When truthy (1, true, y, yes), treat all y/N prompts as Yes. Useful for non-interactive runs or to accept defaults quickly. Example: `bundle exec rake kettle:dev:template force=true`
|
242
242
|
- option: allowed: When truthy (1, true, y, yes), resume task after you have reviewed `.envrc`/`.env.local` and run `direnv allow`. If either file is created or updated, the task will abort with instructions unless `allowed=true` is present. Example: `bundle exec rake kettle:dev:install allowed=true`
|
243
243
|
- option: only: A comma-separated list of glob patterns to include in templating. Any destination file whose path+filename does not match one of the patterns is excluded. Patterns are matched relative to your project root. Examples: `only="README.md,.github/**"`, `only="docs/**,lib/**/*.rb"`.
|
244
|
+
- option: include: A comma-separated list of glob patterns that opt-in additional, non-default files. Currently, `.github/workflows/discord-notifier.yml` is not copied by default and will only be copied when `include` matches it (e.g., `include=".github/workflows/discord-notifier.yml"`).
|
244
245
|
- `kettle:dev:template` โ templates files from this gem into your project (e.g., .github workflows, .devcontainer, .qlty, modular Gemfiles, README/CONTRIBUTING stubs). You can run this independently to refresh templates without the extra install prompts.
|
245
246
|
- option: force: When truthy (1, true, y, yes), treat all y/N prompts as Yes. Useful for non-interactive runs or to accept defaults quickly. Example: `bundle exec rake kettle:dev:template force=true`
|
246
247
|
- option: allowed: When truthy (1, true, y, yes), resume task after you have reviewed `.envrc`/`.env.local` and run `direnv allow`. If either file is created or updated, the task will abort with instructions unless `allowed=true` is present. Example: `bundle exec rake kettle:dev:template allowed=true`
|
247
248
|
- option: only: Same as for install; limits which destination files are written based on glob patterns relative to the project root.
|
249
|
+
- option: include: Same as for install; opts into optional files (e.g., `.github/workflows/discord-notifier.yml`).
|
248
250
|
|
249
251
|
Recommended one-time setup in your project:
|
250
252
|
- Install binstubs so kettle-dev executables are available under `./bin`:
|
@@ -506,6 +508,7 @@ What it does:
|
|
506
508
|
- `--force` Pass `force=true` to accept prompts non-interactively.
|
507
509
|
- `--hook_templates=VAL` Pass `hook_templates=VAL` to control git hook templating.
|
508
510
|
- `--only=VAL` Pass `only=VAL` to restrict install scope.
|
511
|
+
- `--include=VAL` Pass `include=VAL` to include optional files by glob (see notes below).
|
509
512
|
- `-h`, `--help` Show help.
|
510
513
|
- Behavior:
|
511
514
|
- Verifies a clean git working tree, presence of a Gemfile and a gemspec.
|
@@ -620,11 +623,11 @@ See [CONTRIBUTING.md][๐คcontributing].
|
|
620
623
|
|
621
624
|
### Code Coverage
|
622
625
|
|
623
|
-
[![Coverage Graph][
|
626
|
+
[![Coverage Graph][๐codecov-g]][๐codecov]
|
624
627
|
|
625
|
-
[![Coveralls Test Coverage][
|
628
|
+
[![Coveralls Test Coverage][๐coveralls-img]][๐coveralls]
|
626
629
|
|
627
|
-
[![QLTY Test Coverage][
|
630
|
+
[![QLTY Test Coverage][๐qlty-covi]][๐qlty-cov]
|
628
631
|
|
629
632
|
### ๐ช Code of Conduct
|
630
633
|
|
@@ -815,22 +818,24 @@ Thanks for RTFM. โบ๏ธ
|
|
815
818
|
[๐src-gh]: https://github.com/kettle-rb/kettle-dev
|
816
819
|
[๐docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
|
817
820
|
[๐docs-head-rd-img]: https://img.shields.io/badge/YARD_on_Galtzo.com-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
|
818
|
-
[๐wiki]: https://gitlab.com/kettle-rb/kettle-dev/-/wikis/home
|
819
|
-
[๐wiki
|
821
|
+
[๐gl-wiki]: https://gitlab.com/kettle-rb/kettle-dev/-/wikis/home
|
822
|
+
[๐gh-wiki]: https://github.com/kettle-rb/kettle-dev/wiki
|
823
|
+
[๐gl-wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=gitlab&logoColor=white
|
824
|
+
[๐gh-wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=github&logoColor=white
|
820
825
|
[๐ฝdl-rank]: https://rubygems.org/gems/kettle-dev
|
821
826
|
[๐ฝdl-ranki]: https://img.shields.io/gem/rd/kettle-dev.svg
|
822
827
|
[๐ฝoss-help]: https://www.codetriage.com/kettle-rb/kettle-dev
|
823
828
|
[๐ฝoss-helpi]: https://www.codetriage.com/kettle-rb/kettle-dev/badges/users.svg
|
824
829
|
[๐ฝversion]: https://rubygems.org/gems/kettle-dev
|
825
830
|
[๐ฝversioni]: https://img.shields.io/gem/v/kettle-dev.svg
|
826
|
-
[
|
827
|
-
[
|
828
|
-
[
|
829
|
-
[
|
830
|
-
[
|
831
|
-
[
|
832
|
-
[
|
833
|
-
[
|
831
|
+
[๐qlty-mnt]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev
|
832
|
+
[๐qlty-mnti]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev/maintainability.svg
|
833
|
+
[๐qlty-cov]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev/metrics/code?sort=coverageRating
|
834
|
+
[๐qlty-covi]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev/coverage.svg
|
835
|
+
[๐codecov]: https://codecov.io/gh/kettle-rb/kettle-dev
|
836
|
+
[๐codecovi]: https://codecov.io/gh/kettle-rb/kettle-dev/graph/badge.svg
|
837
|
+
[๐coveralls]: https://coveralls.io/github/kettle-rb/kettle-dev?branch=main
|
838
|
+
[๐coveralls-img]: https://coveralls.io/repos/github/kettle-rb/kettle-dev/badge.svg?branch=main
|
834
839
|
[๐codeQL]: https://github.com/kettle-rb/kettle-dev/security/code-scanning
|
835
840
|
[๐codeQL-img]: https://github.com/kettle-rb/kettle-dev/actions/workflows/codeql-analysis.yml/badge.svg
|
836
841
|
[๐1-an-wf]: https://github.com/kettle-rb/kettle-dev/actions/workflows/ancient.yml
|
@@ -893,7 +898,7 @@ Thanks for RTFM. โบ๏ธ
|
|
893
898
|
[๐คcb-pulls]: https://codeberg.org/kettle-rb/kettle-dev/pulls
|
894
899
|
[๐คcb-donate]: https://donate.codeberg.org/
|
895
900
|
[๐คcontributing]: CONTRIBUTING.md
|
896
|
-
[
|
901
|
+
[๐codecov-g]: https://codecov.io/gh/kettle-rb/kettle-dev/graphs/tree.svg
|
897
902
|
[๐contrib-rocks]: https://contrib.rocks
|
898
903
|
[๐contributors]: https://github.com/kettle-rb/kettle-dev/graphs/contributors
|
899
904
|
[๐contributors-img]: https://contrib.rocks/image?repo=kettle-rb/kettle-dev
|
@@ -911,7 +916,7 @@ Thanks for RTFM. โบ๏ธ
|
|
911
916
|
[๐gitmoji]:https://gitmoji.dev
|
912
917
|
[๐gitmoji-img]:https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
913
918
|
[๐งฎkloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
914
|
-
[๐งฎkloc-img]: https://img.shields.io/badge/KLOC-3.
|
919
|
+
[๐งฎkloc-img]: https://img.shields.io/badge/KLOC-3.781-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
915
920
|
[๐security]: SECURITY.md
|
916
921
|
[๐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
917
922
|
[๐copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
data/README.md.example
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
# ๐ฒ Kettle::Dev
|
11
11
|
|
12
|
-
[![Version][๐ฝversioni]][๐ฝversion] [![GitHub tag (latest SemVer)][โณ๏ธtag-img]][โณ๏ธtag] [![License: MIT][๐license-img]][๐license-ref] [![Downloads Rank][๐ฝdl-ranki]][๐ฝdl-rank] [![Open Source Helpers][๐ฝoss-helpi]][๐ฝoss-help] [![CodeCov Test Coverage][
|
12
|
+
[![Version][๐ฝversioni]][๐ฝversion] [![GitHub tag (latest SemVer)][โณ๏ธtag-img]][โณ๏ธtag] [![License: MIT][๐license-img]][๐license-ref] [![Downloads Rank][๐ฝdl-ranki]][๐ฝdl-rank] [![Open Source Helpers][๐ฝoss-helpi]][๐ฝoss-help] [![CodeCov Test Coverage][๐codecovi]][๐codecov] [![Coveralls Test Coverage][๐coveralls-img]][๐coveralls] [![QLTY Test Coverage][๐qlty-covi]][๐qlty-cov] [![QLTY Maintainability][๐qlty-mnti]][๐qlty-mnt] [![CI Heads][๐3-hd-wfi]][๐3-hd-wf] [![CI Runtime Dependencies @ HEAD][๐12-crh-wfi]][๐12-crh-wf] [![CI Current][๐11-c-wfi]][๐11-c-wf] [![CI Truffle Ruby][๐9-t-wfi]][๐9-t-wf] [![CI JRuby][๐10-j-wfi]][๐10-j-wf] [![Deps Locked][๐13-๐๏ธ-wfi]][๐13-๐๏ธ-wf] [![Deps Unlocked][๐14-๐๏ธ-wfi]][๐14-๐๏ธ-wf] [![CI Supported][๐6-s-wfi]][๐6-s-wf] [![CI Legacy][๐4-lg-wfi]][๐4-lg-wf] [![CI Unsupported][๐7-us-wfi]][๐7-us-wf] [![CI Ancient][๐1-an-wfi]][๐1-an-wf] [![CI Test Coverage][๐2-cov-wfi]][๐2-cov-wf] [![CI Style][๐5-st-wfi]][๐5-st-wf] [![CodeQL][๐codeQL-img]][๐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][๐15-๐ชช-wfi]][๐15-๐ชช-wf]
|
13
13
|
|
14
14
|
`if ci_badges.map(&:color).detect { it != "green"}` โ๏ธ [let me know][๐ผ๏ธgaltzo-discord], as I may have missed the [discord notification][๐ผ๏ธgaltzo-discord].
|
15
15
|
|
@@ -24,20 +24,20 @@
|
|
24
24
|
|
25
25
|
## ๐ก Info you can shake a stick at
|
26
26
|
|
27
|
-
| Tokens to Remember | [![Gem name][โณ๏ธname-img]][โณ๏ธgem-name] [![Gem namespace][โณ๏ธnamespace-img]][โณ๏ธgem-namespace]
|
28
|
-
|
29
|
-
| Works with JRuby | ![JRuby 9.1 Compat][๐jruby-9.1i] ![JRuby 9.2 Compat][๐jruby-9.2i] ![JRuby 9.3 Compat][๐jruby-9.3i] <br/> [![JRuby 9.4 Compat][๐jruby-9.4i]][๐10-j-wf] [![JRuby 10.0 Compat][๐jruby-c-i]][๐11-c-wf] [![JRuby HEAD Compat][๐jruby-headi]][๐3-hd-wf]
|
30
|
-
| Works with Truffle Ruby | ![Truffle Ruby 22.3 Compat][๐truby-22.3i] ![Truffle Ruby 23.0 Compat][๐truby-23.0i] <br/> [![Truffle Ruby 23.1 Compat][๐truby-23.1i]][๐9-t-wf] [![Truffle Ruby 24.1 Compat][๐truby-c-i]][๐11-c-wf]
|
31
|
-
| Works with MRI Ruby 3 | [![Ruby 3.0 Compat][๐ruby-3.0i]][๐4-lg-wf] [![Ruby 3.1 Compat][๐ruby-3.1i]][๐6-s-wf] [![Ruby 3.2 Compat][๐ruby-3.2i]][๐6-s-wf] [![Ruby 3.3 Compat][๐ruby-3.3i]][๐6-s-wf] [![Ruby 3.4 Compat][๐ruby-c-i]][๐11-c-wf] [![Ruby HEAD Compat][๐ruby-headi]][๐3-hd-wf]
|
32
|
-
| 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] <br/> [![Ruby 2.3 Compat][๐ruby-2.3i]][๐1-an-wf] [![Ruby 2.4 Compat][๐ruby-2.4i]][๐1-an-wf] [![Ruby 2.5 Compat][๐ruby-2.5i]][๐1-an-wf] [![Ruby 2.6 Compat][๐ruby-2.6i]][๐7-us-wf] [![Ruby 2.7 Compat][๐ruby-2.7i]][๐7-us-wf]
|
33
|
-
| Works with MRI Ruby 1 | ![Ruby 1.8 Compat][๐ruby-1.8i] ![Ruby 1.9 Compat][๐ruby-1.9i]
|
34
|
-
| Support & Community | [![Join Me on Daily.dev's RubyFriends][โ๏ธruby-friends-img]][โ๏ธruby-friends] [![Live Chat on Discord][โ๏ธdiscord-invite-img-ftb]][โ๏ธdiscord-invite] [![Get help from me on Upwork][๐จ๐ผโ๐ซexpsup-upwork-img]][๐จ๐ผโ๐ซexpsup-upwork] [![Get help from me on Codementor][๐จ๐ผโ๐ซexpsup-codementor-img]][๐จ๐ผโ๐ซexpsup-codementor]
|
35
|
-
| Source | [![Source on GitLab.com][๐src-gl-img]][๐src-gl] [![Source on CodeBerg.org][๐src-cb-img]][๐src-cb] [![Source on Github.com][๐src-gh-img]][๐src-gh] [![The best SHA: dQw4w9WgXcQ!][๐งฎkloc-img]][๐งฎkloc]
|
36
|
-
| Documentation | [![Current release on RubyDoc.info][๐docs-cr-rd-img]][๐yard-current] [![YARD on Galtzo.com][๐docs-head-rd-img]][๐yard-head] [![Maintainer Blog][๐maint-blog-img]][๐maint-blog] [![Wiki][๐wiki-img]][๐wiki]
|
37
|
-
| Compliance | [![License: MIT][๐license-img]][๐license-ref] [![Compatible with Apache Software Projects: Verified by SkyWalking Eyes][๐license-compat-img]][๐license-compat] [![๐ilo-declaration-img]][๐ilo-declaration] [![Security Policy][๐security-img]][๐security] [![Contributor Covenant 2.1][๐ชconduct-img]][๐ชconduct] [![SemVer 2.0.0][๐semver-img]][๐semver]
|
38
|
-
| Style | [![Enforced Code Style Linter][๐rlts-img]][๐rlts] [![Keep-A-Changelog 1.0.0][๐keep-changelog-img]][๐keep-changelog] [![Gitmoji Commits][๐gitmoji-img]][๐gitmoji] [![Compatibility appraised by: appraisal2][๐appraisal2-img]][๐appraisal2]
|
39
|
-
| Maintainer ๐๏ธ | [![Follow Me on LinkedIn][๐๐linkedin-img]][๐๐linkedin] [![Follow Me on Ruby.Social][๐๐ruby-mast-img]][๐๐ruby-mast] [![Follow Me on Bluesky][๐๐ฆbluesky-img]][๐๐ฆbluesky] [![Contact Maintainer][๐maint-contact-img]][๐maint-contact] [![My technical writing][๐๐๐ผโโ๏ธdevto-img]][๐๐๐ผโโ๏ธdevto]
|
40
|
-
| `...` ๐ | [![Find Me on WellFound:][๐โ๏ธwellfound-img]][๐โ๏ธwellfound] [![Find Me on CrunchBase][๐๐ฒcrunchbase-img]][๐๐ฒcrunchbase] [![My LinkTree][๐๐ณlinktree-img]][๐๐ณlinktree] [![More About Me][๐๐๐ผโโ๏ธaboutme-img]][๐๐๐ผโโ๏ธaboutme] [๐ง][๐๐งberg] [๐][๐๐hub] [๐][๐๐hut] [๐งช][๐๐งชlab]
|
27
|
+
| Tokens to Remember | [![Gem name][โณ๏ธname-img]][โณ๏ธgem-name] [![Gem namespace][โณ๏ธnamespace-img]][โณ๏ธgem-namespace] |
|
28
|
+
|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
29
|
+
| Works with JRuby | ![JRuby 9.1 Compat][๐jruby-9.1i] ![JRuby 9.2 Compat][๐jruby-9.2i] ![JRuby 9.3 Compat][๐jruby-9.3i] <br/> [![JRuby 9.4 Compat][๐jruby-9.4i]][๐10-j-wf] [![JRuby 10.0 Compat][๐jruby-c-i]][๐11-c-wf] [![JRuby HEAD Compat][๐jruby-headi]][๐3-hd-wf] |
|
30
|
+
| Works with Truffle Ruby | ![Truffle Ruby 22.3 Compat][๐truby-22.3i] ![Truffle Ruby 23.0 Compat][๐truby-23.0i] <br/> [![Truffle Ruby 23.1 Compat][๐truby-23.1i]][๐9-t-wf] [![Truffle Ruby 24.1 Compat][๐truby-c-i]][๐11-c-wf] |
|
31
|
+
| Works with MRI Ruby 3 | [![Ruby 3.0 Compat][๐ruby-3.0i]][๐4-lg-wf] [![Ruby 3.1 Compat][๐ruby-3.1i]][๐6-s-wf] [![Ruby 3.2 Compat][๐ruby-3.2i]][๐6-s-wf] [![Ruby 3.3 Compat][๐ruby-3.3i]][๐6-s-wf] [![Ruby 3.4 Compat][๐ruby-c-i]][๐11-c-wf] [![Ruby HEAD Compat][๐ruby-headi]][๐3-hd-wf] |
|
32
|
+
| 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] <br/> [![Ruby 2.3 Compat][๐ruby-2.3i]][๐1-an-wf] [![Ruby 2.4 Compat][๐ruby-2.4i]][๐1-an-wf] [![Ruby 2.5 Compat][๐ruby-2.5i]][๐1-an-wf] [![Ruby 2.6 Compat][๐ruby-2.6i]][๐7-us-wf] [![Ruby 2.7 Compat][๐ruby-2.7i]][๐7-us-wf] |
|
33
|
+
| Works with MRI Ruby 1 | ![Ruby 1.8 Compat][๐ruby-1.8i] ![Ruby 1.9 Compat][๐ruby-1.9i] |
|
34
|
+
| Support & Community | [![Join Me on Daily.dev's RubyFriends][โ๏ธruby-friends-img]][โ๏ธruby-friends] [![Live Chat on Discord][โ๏ธdiscord-invite-img-ftb]][โ๏ธdiscord-invite] [![Get help from me on Upwork][๐จ๐ผโ๐ซexpsup-upwork-img]][๐จ๐ผโ๐ซexpsup-upwork] [![Get help from me on Codementor][๐จ๐ผโ๐ซexpsup-codementor-img]][๐จ๐ผโ๐ซexpsup-codementor] |
|
35
|
+
| Source | [![Source on GitLab.com][๐src-gl-img]][๐src-gl] [![Source on CodeBerg.org][๐src-cb-img]][๐src-cb] [![Source on Github.com][๐src-gh-img]][๐src-gh] [![The best SHA: dQw4w9WgXcQ!][๐งฎkloc-img]][๐งฎkloc] |
|
36
|
+
| Documentation | [![Current release on RubyDoc.info][๐docs-cr-rd-img]][๐yard-current] [![YARD on Galtzo.com][๐docs-head-rd-img]][๐yard-head] [![Maintainer Blog][๐maint-blog-img]][๐maint-blog] [![GitLab Wiki][๐gl-wiki-img]][๐gl-wiki] [![GitHub Wiki][๐gh-wiki-img]][๐gh-wiki] |
|
37
|
+
| Compliance | [![License: MIT][๐license-img]][๐license-ref] [![Compatible with Apache Software Projects: Verified by SkyWalking Eyes][๐license-compat-img]][๐license-compat] [![๐ilo-declaration-img]][๐ilo-declaration] [![Security Policy][๐security-img]][๐security] [![Contributor Covenant 2.1][๐ชconduct-img]][๐ชconduct] [![SemVer 2.0.0][๐semver-img]][๐semver] |
|
38
|
+
| Style | [![Enforced Code Style Linter][๐rlts-img]][๐rlts] [![Keep-A-Changelog 1.0.0][๐keep-changelog-img]][๐keep-changelog] [![Gitmoji Commits][๐gitmoji-img]][๐gitmoji] [![Compatibility appraised by: appraisal2][๐appraisal2-img]][๐appraisal2] |
|
39
|
+
| Maintainer ๐๏ธ | [![Follow Me on LinkedIn][๐๐linkedin-img]][๐๐linkedin] [![Follow Me on Ruby.Social][๐๐ruby-mast-img]][๐๐ruby-mast] [![Follow Me on Bluesky][๐๐ฆbluesky-img]][๐๐ฆbluesky] [![Contact Maintainer][๐maint-contact-img]][๐maint-contact] [![My technical writing][๐๐๐ผโโ๏ธdevto-img]][๐๐๐ผโโ๏ธdevto] |
|
40
|
+
| `...` ๐ | [![Find Me on WellFound:][๐โ๏ธwellfound-img]][๐โ๏ธwellfound] [![Find Me on CrunchBase][๐๐ฒcrunchbase-img]][๐๐ฒcrunchbase] [![My LinkTree][๐๐ณlinktree-img]][๐๐ณlinktree] [![More About Me][๐๐๐ผโโ๏ธaboutme-img]][๐๐๐ผโโ๏ธaboutme] [๐ง][๐๐งberg] [๐][๐๐hub] [๐][๐๐hut] [๐งช][๐๐งชlab] |
|
41
41
|
|
42
42
|
### Compatibility
|
43
43
|
|
@@ -50,13 +50,13 @@ Compatible with MRI Ruby 2.3+, and concordant releases of JRuby, and TruffleRuby
|
|
50
50
|
### Federated DVCS
|
51
51
|
|
52
52
|
<details>
|
53
|
-
<summary>Find this repo on
|
53
|
+
<summary>Find this repo on federated forges (Coming soon!)</summary>
|
54
54
|
|
55
55
|
| Federated [DVCS][๐d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI | Discussions |
|
56
56
|
|-------------------------------------------------|-----------------------------------------------------------------------|---------------------------|--------------------------|---------------------------|--------------------------|------------------------------|
|
57
|
-
| ๐งช [kettle-rb/kettle-dev on GitLab][๐src-gl] | The Truth | [๐][๐คgl-issues] | [๐][๐คgl-pulls] | [๐][๐wiki]
|
57
|
+
| ๐งช [kettle-rb/kettle-dev on GitLab][๐src-gl] | The Truth | [๐][๐คgl-issues] | [๐][๐คgl-pulls] | [๐][๐gl-wiki] | ๐ญ Tiny Matrix | โ |
|
58
58
|
| ๐ง [kettle-rb/kettle-dev on CodeBerg][๐src-cb] | An Ethical Mirror ([Donate][๐คcb-donate]) | [๐][๐คcb-issues] | [๐][๐คcb-pulls] | โ | โญ๏ธ No Matrix | โ |
|
59
|
-
| ๐ [kettle-rb/kettle-dev on GitHub][๐src-gh] | Another Mirror | [๐][๐คgh-issues] | [๐][๐คgh-pulls] |
|
59
|
+
| ๐ [kettle-rb/kettle-dev on GitHub][๐src-gh] | Another Mirror | [๐][๐คgh-issues] | [๐][๐คgh-pulls] | [๐][๐gh-wiki] | ๐ฏ Full Matrix | [๐][gh-discussions] |
|
60
60
|
| ๐ฎ๏ธ [Discord Server][โ๏ธdiscord-invite] | [![Live Chat on Discord][โ๏ธdiscord-invite-img-ftb]][โ๏ธdiscord-invite] | [Let's][โ๏ธdiscord-invite] | [talk][โ๏ธdiscord-invite] | [about][โ๏ธdiscord-invite] | [this][โ๏ธdiscord-invite] | [library!][โ๏ธdiscord-invite] |
|
61
61
|
|
62
62
|
</details>
|
@@ -215,11 +215,11 @@ See [CONTRIBUTING.md][๐คcontributing].
|
|
215
215
|
|
216
216
|
### Code Coverage
|
217
217
|
|
218
|
-
[![Coverage Graph][
|
218
|
+
[![Coverage Graph][๐codecov-g]][๐codecov]
|
219
219
|
|
220
|
-
[![Coveralls Test Coverage][
|
220
|
+
[![Coveralls Test Coverage][๐coveralls-img]][๐coveralls]
|
221
221
|
|
222
|
-
[![QLTY Test Coverage][
|
222
|
+
[![QLTY Test Coverage][๐qlty-covi]][๐qlty-cov]
|
223
223
|
|
224
224
|
### ๐ช Code of Conduct
|
225
225
|
|
@@ -410,22 +410,24 @@ Thanks for RTFM. โบ๏ธ
|
|
410
410
|
[๐src-gh]: https://github.com/kettle-rb/kettle-dev
|
411
411
|
[๐docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
|
412
412
|
[๐docs-head-rd-img]: https://img.shields.io/badge/YARD_on_Galtzo.com-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
|
413
|
-
[๐wiki]: https://gitlab.com/kettle-rb/kettle-dev/-/wikis/home
|
414
|
-
[๐wiki
|
413
|
+
[๐gl-wiki]: https://gitlab.com/kettle-rb/kettle-dev/-/wikis/home
|
414
|
+
[๐gh-wiki]: https://github.com/kettle-rb/kettle-dev/wiki
|
415
|
+
[๐gl-wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=gitlab&logoColor=white
|
416
|
+
[๐gh-wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=github&logoColor=white
|
415
417
|
[๐ฝdl-rank]: https://rubygems.org/gems/kettle-dev
|
416
418
|
[๐ฝdl-ranki]: https://img.shields.io/gem/rd/kettle-dev.svg
|
417
419
|
[๐ฝoss-help]: https://www.codetriage.com/kettle-rb/kettle-dev
|
418
420
|
[๐ฝoss-helpi]: https://www.codetriage.com/kettle-rb/kettle-dev/badges/users.svg
|
419
421
|
[๐ฝversion]: https://rubygems.org/gems/kettle-dev
|
420
422
|
[๐ฝversioni]: https://img.shields.io/gem/v/kettle-dev.svg
|
421
|
-
[
|
422
|
-
[
|
423
|
-
[
|
424
|
-
[
|
425
|
-
[
|
426
|
-
[
|
427
|
-
[
|
428
|
-
[
|
423
|
+
[๐qlty-mnt]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev
|
424
|
+
[๐qlty-mnti]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev/maintainability.svg
|
425
|
+
[๐qlty-cov]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev/metrics/code?sort=coverageRating
|
426
|
+
[๐qlty-covi]: https://qlty.sh/gh/kettle-rb/projects/kettle-dev/coverage.svg
|
427
|
+
[๐codecov]: https://codecov.io/gh/kettle-rb/kettle-dev
|
428
|
+
[๐codecovi]: https://codecov.io/gh/kettle-rb/kettle-dev/graph/badge.svg
|
429
|
+
[๐coveralls]: https://coveralls.io/github/kettle-rb/kettle-dev?branch=main
|
430
|
+
[๐coveralls-img]: https://coveralls.io/repos/github/kettle-rb/kettle-dev/badge.svg?branch=main
|
429
431
|
[๐codeQL]: https://github.com/kettle-rb/kettle-dev/security/code-scanning
|
430
432
|
[๐codeQL-img]: https://github.com/kettle-rb/kettle-dev/actions/workflows/codeql-analysis.yml/badge.svg
|
431
433
|
[๐1-an-wf]: https://github.com/kettle-rb/kettle-dev/actions/workflows/ancient.yml
|
@@ -493,7 +495,7 @@ Thanks for RTFM. โบ๏ธ
|
|
493
495
|
[๐คcb-pulls]: https://codeberg.org/kettle-rb/kettle-dev/pulls
|
494
496
|
[๐คcb-donate]: https://donate.codeberg.org/
|
495
497
|
[๐คcontributing]: CONTRIBUTING.md
|
496
|
-
[
|
498
|
+
[๐codecov-g]: https://codecov.io/gh/kettle-rb/kettle-dev/graphs/tree.svg
|
497
499
|
[๐contrib-rocks]: https://contrib.rocks
|
498
500
|
[๐contributors]: https://github.com/kettle-rb/kettle-dev/graphs/contributors
|
499
501
|
[๐contributors-img]: https://contrib.rocks/image?repo=kettle-rb/kettle-dev
|
@@ -511,7 +513,7 @@ Thanks for RTFM. โบ๏ธ
|
|
511
513
|
[๐gitmoji]:https://gitmoji.dev
|
512
514
|
[๐gitmoji-img]:https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
513
515
|
[๐งฎkloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
514
|
-
[๐งฎkloc-img]: https://img.shields.io/badge/KLOC-3.
|
516
|
+
[๐งฎkloc-img]: https://img.shields.io/badge/KLOC-3.781-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
515
517
|
[๐security]: SECURITY.md
|
516
518
|
[๐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
517
519
|
[๐copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
data/Rakefile.example
CHANGED
data/exe/kettle-dev-setup
CHANGED
@@ -24,9 +24,22 @@ module Kettle
|
|
24
24
|
|
25
25
|
changelog = File.read(@changelog_path)
|
26
26
|
|
27
|
-
# If the detected version already exists in the changelog,
|
27
|
+
# If the detected version already exists in the changelog, offer reformat-only mode
|
28
28
|
if changelog =~ /^## \[#{Regexp.escape(version)}\]/
|
29
|
-
|
29
|
+
warn("CHANGELOG.md already has a section for version #{version}.")
|
30
|
+
warn("It appears the version has not been bumped. You can reformat CHANGELOG.md without adding a new release section.")
|
31
|
+
print("Proceed with reformat only? [y/N]: ")
|
32
|
+
ans = Kettle::Dev::InputAdapter.gets&.strip&.downcase
|
33
|
+
if ans == "y" || ans == "yes"
|
34
|
+
updated = normalize_heading_spacing(changelog)
|
35
|
+
updated = ensure_footer_spacing(updated)
|
36
|
+
updated = updated.rstrip + "\n"
|
37
|
+
File.write(@changelog_path, updated)
|
38
|
+
puts "CHANGELOG.md reformatted. No new version section added."
|
39
|
+
return
|
40
|
+
else
|
41
|
+
abort("Aborting: version not bumped. Re-run after bumping version or answer 'y' to reformat-only.")
|
42
|
+
end
|
30
43
|
end
|
31
44
|
|
32
45
|
unreleased_block, before, after = extract_unreleased(changelog)
|
@@ -86,6 +99,9 @@ module Kettle
|
|
86
99
|
|
87
100
|
updated = update_link_refs(updated, owner, repo, prev_version, version)
|
88
101
|
|
102
|
+
# Normalize spacing around headings to aid Markdown renderers
|
103
|
+
updated = normalize_heading_spacing(updated)
|
104
|
+
|
89
105
|
# Ensure exactly one trailing newline at EOF
|
90
106
|
updated = updated.rstrip + "\n"
|
91
107
|
|
@@ -340,10 +356,71 @@ module Kettle
|
|
340
356
|
new_ref_block << tags[v] if tags[v]
|
341
357
|
end
|
342
358
|
# Replace the old block
|
343
|
-
|
359
|
+
head = lines[0...first_ref]
|
360
|
+
# Ensure exactly one blank line separating body content from the reference block
|
361
|
+
if head.any? && head.last.to_s.strip != ""
|
362
|
+
head << "\n"
|
363
|
+
end
|
364
|
+
rebuilt = head + new_ref_block + ["\n"]
|
344
365
|
rebuilt.join
|
345
366
|
end
|
346
367
|
|
368
|
+
# Ensure every Markdown atx-style heading line (e.g., "# ", "## ") has exactly one blank line
|
369
|
+
# before and after it, skipping content inside fenced code blocks.
|
370
|
+
def normalize_heading_spacing(text)
|
371
|
+
lines = text.split("\n", -1)
|
372
|
+
out = []
|
373
|
+
in_fence = false
|
374
|
+
fence_re = /^\s*```/
|
375
|
+
heading_re = /^\s*#+\s+.+/
|
376
|
+
lines.each_with_index do |ln, idx|
|
377
|
+
if ln =~ fence_re
|
378
|
+
in_fence = !in_fence
|
379
|
+
out << ln
|
380
|
+
next
|
381
|
+
end
|
382
|
+
if !in_fence && ln =~ heading_re
|
383
|
+
# Ensure previous line is blank (unless start of file or already blank)
|
384
|
+
prev_blank = out.empty? ? false : out.last.to_s.strip == ""
|
385
|
+
out << "" unless out.empty? || prev_blank
|
386
|
+
out << ln
|
387
|
+
# Peek at next line in source to decide if we need to inject a blank now.
|
388
|
+
nxt = lines[idx + 1]
|
389
|
+
out << "" unless nxt.to_s.strip == ""
|
390
|
+
else
|
391
|
+
out << ln
|
392
|
+
end
|
393
|
+
end
|
394
|
+
# Collapse multiple consecutive blank lines down to a single between regions that our logic might have doubled
|
395
|
+
collapsed = []
|
396
|
+
lines_enum = out
|
397
|
+
lines_enum.each do |l|
|
398
|
+
if l.strip == "" && collapsed.last.to_s.strip == ""
|
399
|
+
next
|
400
|
+
end
|
401
|
+
collapsed << l
|
402
|
+
end
|
403
|
+
collapsed.join("\n")
|
404
|
+
end
|
405
|
+
|
406
|
+
def ensure_footer_spacing(text)
|
407
|
+
lines = text.split("\n", -1)
|
408
|
+
# Find the Unreleased link-ref which denotes start of footer refs
|
409
|
+
idx = lines.index { |l| l.start_with?(UNRELEASED_SECTION_HEADING) }
|
410
|
+
return text unless idx
|
411
|
+
head = lines[0...idx]
|
412
|
+
tail = lines[idx..-1]
|
413
|
+
# Ensure exactly one blank line between body and refs
|
414
|
+
if head.any? && head.last.to_s.strip != ""
|
415
|
+
head << ""
|
416
|
+
elsif head.any? && head.last.to_s.strip == "" && head[-2].to_s.strip == ""
|
417
|
+
# Collapse multiple blanks before footer to a single
|
418
|
+
head.pop while head.any? && head.last.to_s.strip == ""
|
419
|
+
head << ""
|
420
|
+
end
|
421
|
+
(head + tail).join("\n")
|
422
|
+
end
|
423
|
+
|
347
424
|
def detect_initial_compare_base(lines)
|
348
425
|
# Fallback when prev_version is unknown: try to find the first compare base used historically
|
349
426
|
# e.g., for 1.0.0 it may be a commit SHA instead of a tag
|
@@ -106,16 +106,22 @@ module Kettle
|
|
106
106
|
if funding_org_env && funding_org_env.to_s.strip.casecmp("false").zero?
|
107
107
|
funding_org = nil
|
108
108
|
else
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
109
|
+
# Prefer .opencollective.yml when present so that specs forcing the file path are stable
|
110
|
+
oc_path = File.join(root.to_s, ".opencollective.yml")
|
111
|
+
if File.file?(oc_path)
|
112
|
+
txt = File.read(oc_path)
|
113
|
+
funding_org = if (m = txt.match(/\borg:\s*([\w\-]+)/i))
|
114
|
+
m[1].to_s
|
115
|
+
else
|
116
|
+
""
|
117
117
|
end
|
118
118
|
end
|
119
|
+
|
120
|
+
# Fallback to ENV when file not present or did not contain an org
|
121
|
+
if funding_org.to_s.strip.empty?
|
122
|
+
funding_org = ENV["OPENCOLLECTIVE_HANDLE"].to_s.strip if funding_org.empty?
|
123
|
+
end
|
124
|
+
|
119
125
|
# Be lenient: if funding_org cannot be determined, do not raise โ leave it nil and warn.
|
120
126
|
if funding_org.to_s.empty?
|
121
127
|
Kernel.warn("kettle-dev: Could not determine funding org.\n - Options:\n * Set ENV['FUNDING_ORG'] to your funding handle (e.g., 'opencollective-handle').\n * Or set ENV['OPENCOLLECTIVE_HANDLE'].\n * Or add .opencollective.yml with: org: <handle>\n * Or bypass by setting ENV['FUNDING_ORG']=false for gems without funding.")
|
@@ -19,8 +19,8 @@ module Kettle
|
|
19
19
|
public
|
20
20
|
|
21
21
|
DEFAULT_AVATAR = "https://opencollective.com/static/images/default-avatar.png"
|
22
|
-
README_PATH = File.expand_path("
|
23
|
-
OC_YML_PATH = File.expand_path("
|
22
|
+
README_PATH = File.expand_path("../../../README.md", __dir__)
|
23
|
+
OC_YML_PATH = File.expand_path("../../../.opencollective.yml", __dir__)
|
24
24
|
README_OSC_TAG_DEFAULT = "OPENCOLLECTIVE"
|
25
25
|
COMMIT_SUBJECT_DEFAULT = "๐ธ Thanks ๐ to our new backers ๐ and subscribers ๐"
|
26
26
|
|
data/lib/kettle/dev/setup_cli.rb
CHANGED
@@ -114,6 +114,7 @@ module Kettle
|
|
114
114
|
end
|
115
115
|
opts.on("--hook_templates=VAL", "Pass through to kettle:dev:install") { |v| @passthrough << "hook_templates=#{v}" }
|
116
116
|
opts.on("--only=VAL", "Pass through to kettle:dev:install") { |v| @passthrough << "only=#{v}" }
|
117
|
+
opts.on("--include=VAL", "Pass through to kettle:dev:install") { |v| @passthrough << "include=#{v}" }
|
117
118
|
opts.on("-h", "--help", "Show help") do
|
118
119
|
puts opts
|
119
120
|
Kettle::Dev::ExitAdapter.exit(0)
|
@@ -10,6 +10,41 @@ module Kettle
|
|
10
10
|
|
11
11
|
module_function
|
12
12
|
|
13
|
+
# Ensure every Markdown atx-style heading line has exactly one blank line
|
14
|
+
# before and after, skipping content inside fenced code blocks.
|
15
|
+
def normalize_heading_spacing(text)
|
16
|
+
lines = text.split("\n", -1)
|
17
|
+
out = []
|
18
|
+
in_fence = false
|
19
|
+
fence_re = /^\s*```/
|
20
|
+
heading_re = /^\s*#+\s+.+/
|
21
|
+
lines.each_with_index do |ln, idx|
|
22
|
+
if ln =~ fence_re
|
23
|
+
in_fence = !in_fence
|
24
|
+
out << ln
|
25
|
+
next
|
26
|
+
end
|
27
|
+
if !in_fence && ln =~ heading_re
|
28
|
+
prev_blank = out.empty? ? false : out.last.to_s.strip == ""
|
29
|
+
out << "" unless out.empty? || prev_blank
|
30
|
+
out << ln
|
31
|
+
nxt = lines[idx + 1]
|
32
|
+
out << "" unless nxt.to_s.strip == ""
|
33
|
+
else
|
34
|
+
out << ln
|
35
|
+
end
|
36
|
+
end
|
37
|
+
# Collapse accidental multiple blanks
|
38
|
+
collapsed = []
|
39
|
+
out.each do |l|
|
40
|
+
if l.strip == "" && collapsed.last.to_s.strip == ""
|
41
|
+
next
|
42
|
+
end
|
43
|
+
collapsed << l
|
44
|
+
end
|
45
|
+
collapsed.join("\n")
|
46
|
+
end
|
47
|
+
|
13
48
|
# Abort wrapper that avoids terminating the entire process during specs
|
14
49
|
def task_abort(msg)
|
15
50
|
raise Kettle::Dev::Error, msg
|
@@ -57,11 +92,48 @@ module Kettle
|
|
57
92
|
selected[key] ||= path
|
58
93
|
end
|
59
94
|
end
|
95
|
+
# Parse optional include patterns (comma-separated globs relative to project root)
|
96
|
+
include_raw = ENV["include"].to_s
|
97
|
+
include_patterns = include_raw.split(",").map { |s| s.strip }.reject(&:empty?)
|
98
|
+
matches_include = lambda do |abs_dest|
|
99
|
+
return false if include_patterns.empty?
|
100
|
+
begin
|
101
|
+
rel_dest = abs_dest.to_s
|
102
|
+
proj = project_root.to_s
|
103
|
+
if rel_dest.start_with?(proj + "/")
|
104
|
+
rel_dest = rel_dest[(proj.length + 1)..-1]
|
105
|
+
elsif rel_dest == proj
|
106
|
+
rel_dest = ""
|
107
|
+
end
|
108
|
+
include_patterns.any? do |pat|
|
109
|
+
if pat.end_with?("/**")
|
110
|
+
base = pat[0..-4]
|
111
|
+
rel_dest == base || rel_dest.start_with?(base + "/")
|
112
|
+
else
|
113
|
+
File.fnmatch?(pat, rel_dest, File::FNM_PATHNAME | File::FNM_EXTGLOB | File::FNM_DOTMATCH)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
rescue StandardError => e
|
117
|
+
Kettle::Dev.debug_error(e, __method__)
|
118
|
+
false
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
60
122
|
selected.values.each do |orig_src|
|
61
123
|
src = helpers.prefer_example(orig_src)
|
62
124
|
# Destination path should never include the .example suffix.
|
63
125
|
rel = orig_src.sub(/^#{Regexp.escape(gem_checkout_root)}\/?/, "").sub(/\.example\z/, "")
|
64
126
|
dest = File.join(project_root, rel)
|
127
|
+
|
128
|
+
# Optional file: .github/workflows/discord-notifier.yml should NOT be copied by default.
|
129
|
+
# Only copy when --include matches it.
|
130
|
+
if rel == ".github/workflows/discord-notifier.yml"
|
131
|
+
unless matches_include.call(dest)
|
132
|
+
# Explicitly skip without prompting
|
133
|
+
next
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
65
137
|
if File.basename(rel) == "FUNDING.yml"
|
66
138
|
helpers.copy_file_with_prompt(src, dest, allow_create: true, allow_replace: true) do |content|
|
67
139
|
c = content.dup
|
@@ -599,14 +671,63 @@ module Kettle
|
|
599
671
|
parse_items = lambda do |body_lines|
|
600
672
|
result = {}
|
601
673
|
cur = nil
|
602
|
-
|
674
|
+
i = 0
|
675
|
+
while i < body_lines.length
|
676
|
+
ln = body_lines[i]
|
603
677
|
if ln.start_with?("### ")
|
604
678
|
cur = ln.strip
|
605
679
|
result[cur] ||= []
|
606
|
-
|
680
|
+
i += 1
|
681
|
+
next
|
682
|
+
end
|
683
|
+
|
684
|
+
# Detect a list item bullet (allow optional indentation)
|
685
|
+
if (m = ln.match(/^(\s*)[-*]\s/))
|
607
686
|
result[cur] ||= []
|
687
|
+
base_indent = m[1].length
|
688
|
+
# Start a new item: include the bullet line
|
608
689
|
result[cur] << ln.rstrip
|
690
|
+
i += 1
|
691
|
+
|
692
|
+
# Include subsequent lines that belong to this list item:
|
693
|
+
# - blank lines
|
694
|
+
# - lines with indentation greater than the bullet's indentation
|
695
|
+
# - any lines inside fenced code blocks (```), regardless of indentation until fence closes
|
696
|
+
in_fence = false
|
697
|
+
fence_re = /^\s*```/
|
698
|
+
while i < body_lines.length
|
699
|
+
l2 = body_lines[i]
|
700
|
+
# Stop if next sibling/top-level bullet of same or smaller indent and not inside a fence
|
701
|
+
if !in_fence && l2 =~ /^(\s*)[-*]\s/
|
702
|
+
ind = Regexp.last_match(1).length
|
703
|
+
break if ind <= base_indent
|
704
|
+
end
|
705
|
+
# Break if a new section heading appears and we're not in a fence
|
706
|
+
break if !in_fence && l2.start_with?("### ")
|
707
|
+
|
708
|
+
if l2 =~ fence_re
|
709
|
+
in_fence = !in_fence
|
710
|
+
result[cur] << l2.rstrip
|
711
|
+
i += 1
|
712
|
+
next
|
713
|
+
end
|
714
|
+
|
715
|
+
# Include blanks and lines indented more than base indent, or anything while in fence
|
716
|
+
if in_fence || l2.strip.empty? || (l2[/^\s*/].length > base_indent)
|
717
|
+
result[cur] << l2.rstrip
|
718
|
+
i += 1
|
719
|
+
next
|
720
|
+
end
|
721
|
+
|
722
|
+
# Otherwise, this line does not belong to the current list item
|
723
|
+
break
|
724
|
+
end
|
725
|
+
|
726
|
+
next
|
609
727
|
end
|
728
|
+
|
729
|
+
# Non-bullet, non-heading line: just advance
|
730
|
+
i += 1
|
610
731
|
end
|
611
732
|
result
|
612
733
|
end
|
@@ -664,6 +785,8 @@ module Kettle
|
|
664
785
|
c = lines.join("\n")
|
665
786
|
end
|
666
787
|
end
|
788
|
+
# Normalize spacing around Markdown headings for broad renderer compatibility
|
789
|
+
c = normalize_heading_spacing(c)
|
667
790
|
c
|
668
791
|
end
|
669
792
|
else
|