kettle-dev 1.0.1 → 1.0.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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.devcontainer/devcontainer.json +26 -0
  4. data/.envrc +42 -0
  5. data/.git-hooks/commit-msg +41 -0
  6. data/.git-hooks/commit-subjects-goalie.txt +8 -0
  7. data/.git-hooks/footer-template.erb.txt +16 -0
  8. data/.git-hooks/prepare-commit-msg +20 -0
  9. data/.github/FUNDING.yml +13 -0
  10. data/.github/dependabot.yml +11 -0
  11. data/.github/workflows/ancient.yml +80 -0
  12. data/.github/workflows/auto-assign.yml +21 -0
  13. data/.github/workflows/codeql-analysis.yml +70 -0
  14. data/.github/workflows/coverage.yml +130 -0
  15. data/.github/workflows/current.yml +88 -0
  16. data/.github/workflows/dependency-review.yml +20 -0
  17. data/.github/workflows/discord-notifier.yml +38 -0
  18. data/.github/workflows/heads.yml +87 -0
  19. data/.github/workflows/jruby.yml +79 -0
  20. data/.github/workflows/legacy.yml +70 -0
  21. data/.github/workflows/locked_deps.yml +88 -0
  22. data/.github/workflows/opencollective.yml +40 -0
  23. data/.github/workflows/style.yml +67 -0
  24. data/.github/workflows/supported.yml +85 -0
  25. data/.github/workflows/truffle.yml +78 -0
  26. data/.github/workflows/unlocked_deps.yml +87 -0
  27. data/.github/workflows/unsupported.yml +78 -0
  28. data/.gitignore +48 -0
  29. data/.gitlab-ci.yml +45 -0
  30. data/.junie/guidelines-rbs.md +49 -0
  31. data/.junie/guidelines.md +132 -0
  32. data/.opencollective.yml +3 -0
  33. data/.qlty/qlty.toml +79 -0
  34. data/.rspec +8 -0
  35. data/.rubocop.yml +13 -0
  36. data/.simplecov +7 -0
  37. data/.tool-versions +1 -0
  38. data/.yard_gfm_support.rb +22 -0
  39. data/.yardopts +11 -0
  40. data/Appraisal.root.gemfile +12 -0
  41. data/Appraisals +120 -0
  42. data/CHANGELOG.md +26 -1
  43. data/Gemfile +32 -0
  44. data/Rakefile +99 -0
  45. data/checksums/kettle-dev-1.0.2.gem.sha256 +1 -0
  46. data/checksums/kettle-dev-1.0.2.gem.sha512 +1 -0
  47. data/checksums/kettle-dev-1.0.3.gem.sha256 +1 -0
  48. data/checksums/kettle-dev-1.0.3.gem.sha512 +1 -0
  49. data/exe/kettle-release +2 -3
  50. data/gemfiles/modular/coverage.gemfile +6 -0
  51. data/gemfiles/modular/documentation.gemfile +11 -0
  52. data/gemfiles/modular/style.gemfile +16 -0
  53. data/lib/kettle/dev/rakelib/appraisal.rake +40 -0
  54. data/lib/kettle/dev/rakelib/bench.rake +58 -0
  55. data/lib/kettle/dev/rakelib/bundle_audit.rake +18 -0
  56. data/lib/kettle/dev/rakelib/ci.rake +348 -0
  57. data/lib/kettle/dev/rakelib/install.rake +304 -0
  58. data/lib/kettle/dev/rakelib/reek.rake +34 -0
  59. data/lib/kettle/dev/rakelib/require_bench.rake +7 -0
  60. data/lib/kettle/dev/rakelib/rubocop_gradual.rake +9 -0
  61. data/lib/kettle/dev/rakelib/spec_test.rake +42 -0
  62. data/lib/kettle/dev/rakelib/template.rake +461 -0
  63. data/lib/kettle/dev/rakelib/yard.rake +33 -0
  64. data/lib/kettle/dev/version.rb +1 -1
  65. data.tar.gz.sig +0 -0
  66. metadata +67 -4
  67. metadata.gz.sig +0 -0
@@ -0,0 +1,78 @@
1
+ name: MRI 2.6 & 2.7 (EOL)
2
+
3
+ env:
4
+ K_SOUP_COV_DO: false
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - 'main'
10
+ tags:
11
+ - '!*' # Do not execute on tags
12
+ pull_request:
13
+ # types specification prevents double build on push & pull request
14
+ # See: https://github.com/Shopify/ruby-style-guide/pull/235#issuecomment-777623642
15
+ types: [opened, synchronize]
16
+ branches:
17
+ - '*'
18
+ # Allow manually triggering the workflow.
19
+ workflow_dispatch:
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ # Cancels all previous workflow runs for the same branch that have not yet completed.
25
+ concurrency:
26
+ # The concurrency group contains the workflow name and the branch name.
27
+ group: "${{ github.workflow }}-${{ github.ref }}"
28
+ cancel-in-progress: true
29
+
30
+ jobs:
31
+ test:
32
+ if: (github.event_name == 'push' || github.event.pull_request.head.repo.owner.login != 'kettle-rb') && !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')
33
+ name: Specs ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
34
+ runs-on: ubuntu-22.04
35
+ continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
36
+ env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
37
+ BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ include:
42
+ # Ruby 2.6
43
+ - ruby: "ruby-2.6"
44
+ appraisal: "ruby-2-6"
45
+ exec_cmd: "rake test"
46
+ gemfile: "Appraisal.root"
47
+ rubygems: '3.4.22'
48
+ bundler: '2.4.22'
49
+
50
+ # Ruby 2.7
51
+ - ruby: "ruby-2.7"
52
+ appraisal: "ruby-2-7"
53
+ exec_cmd: "rake test"
54
+ gemfile: "Appraisal.root"
55
+ rubygems: '3.4.22'
56
+ bundler: '2.4.22'
57
+
58
+ steps:
59
+ - name: Checkout
60
+ uses: actions/checkout@v5
61
+
62
+ - name: Setup Ruby & RubyGems
63
+ uses: ruby/setup-ruby@v1
64
+ with:
65
+ ruby-version: ${{ matrix.ruby }}
66
+ rubygems: ${{ matrix.rubygems }}
67
+ bundler: ${{ matrix.bundler }}
68
+ bundler-cache: false
69
+
70
+ # Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
71
+ # We need to do this first to get appraisal installed.
72
+ # NOTE: This does not use the main Gemfile at all.
73
+ - name: Install Root Appraisal
74
+ run: bundle
75
+ - name: Appraisal for ${{ matrix.appraisal }}
76
+ run: bundle exec appraisal ${{ matrix.appraisal }} bundle
77
+ - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
78
+ run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
data/.gitignore ADDED
@@ -0,0 +1,48 @@
1
+ # Build Artifacts
2
+ /pkg/
3
+ /tmp/
4
+ *.gem
5
+
6
+ # Bundler
7
+ /.bundle/
8
+ /gemfiles/*.lock
9
+ /gemfiles/.bundle/
10
+ /gemfiles/.bundle/config
11
+ /gemfiles/vendor/
12
+ Appraisal.*.gemfile.lock
13
+
14
+ # Specs
15
+ .rspec_status
16
+ /coverage/
17
+ /spec/reports/
18
+ /results/
19
+
20
+ # Documentation
21
+ /.yardoc/
22
+ /_yardoc/
23
+ /rdoc/
24
+ /doc/
25
+
26
+ # Ruby Version Managers (RVM, rbenv, etc)
27
+ # Ignored because we currently use .tool-versions
28
+ .rvmrc
29
+ .ruby-version
30
+ .ruby-gemset
31
+
32
+ # Benchmarking
33
+ /measurement/
34
+
35
+ # Debugger detritus
36
+ .byebug_history
37
+
38
+ # direnv - brew install direnv
39
+ .env.local
40
+
41
+ # OS Detritus
42
+ .DS_Store
43
+
44
+ # Editors
45
+ *~
46
+
47
+ # Sentinels
48
+ .floss_funding.*.lock
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,45 @@
1
+ default:
2
+ image: ruby
3
+
4
+ variables:
5
+ BUNDLE_INSTALL_FLAGS: "--quiet --jobs=$(nproc) --retry=3"
6
+ BUNDLE_FROZEN: "false" # No lockfile!
7
+ BUNDLE_GEMFILE: gemfiles/current.gemfile
8
+ K_SOUP_COV_DEBUG: true
9
+ K_SOUP_COV_DO: true
10
+ K_SOUP_COV_HARD: true
11
+ # Lower than local, which is at 100/100, because rubocop-lts isn't installed in the coverage workflow
12
+ K_SOUP_COV_MIN_BRANCH: 90
13
+ K_SOUP_COV_MIN_LINE: 95
14
+ K_SOUP_COV_VERBOSE: true
15
+ K_SOUP_COV_FORMATTERS: "html,xml,rcov,lcov,json,tty"
16
+ K_SOUP_COV_MULTI_FORMATTERS: true
17
+ K_SOUP_COV_COMMAND_NAME: "RSpec Coverage"
18
+
19
+ workflow:
20
+ rules:
21
+ # For merge requests, create a pipeline.
22
+ - if: '$CI_MERGE_REQUEST_IID'
23
+ # For the ` main ` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
24
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
25
+ # For tags, create a pipeline.
26
+ - if: '$CI_COMMIT_TAG'
27
+
28
+ .current_ruby_template: &current_ruby_template
29
+ image: ruby:${RUBY_VERSION}
30
+ stage: test
31
+ script:
32
+ - gem update --system > /dev/null 2>&1
33
+ - bundle config --local path vendor
34
+ - bundle
35
+ - bundle exec rake
36
+ cache:
37
+ key: ${CI_JOB_IMAGE}
38
+ paths:
39
+ - vendor/ruby
40
+
41
+ current-ruby:
42
+ <<: *current_ruby_template
43
+ parallel:
44
+ matrix:
45
+ - RUBY_VERSION: ["3.2", "3.3", "3.4"]
@@ -0,0 +1,49 @@
1
+ # Junie Project Guidelines Addendum: RBS Documentation
2
+
3
+ This repository ships RBS type signatures under `sig/` which are included in the published gem and referenced by documentation tooling.
4
+
5
+ RBS files must contain only valid RBS syntax. Do not embed Ruby code or YARD-style Ruby documentation constructs in `.rbs` files.
6
+
7
+ Requirements for RBS documentation and signatures:
8
+
9
+ - Use RBS comment style (`# ...`) for notes and documentation inside `.rbs` files.
10
+ - Do not use Ruby heredocs (`<<-DOC`, `<<~RUBY`, etc.) or any Ruby code constructs in `.rbs` files.
11
+ - Do not use Ruby metaprogramming notation like `class << self` in `.rbs`. For singleton methods, use:
12
+ - `def self.method_name: ...`
13
+ - Do not use `extend self` or `module self` in `.rbs`. Declare singleton methods explicitly with `def self.method_name: ...`.
14
+ - Keep type aliases, interfaces, and method signatures in proper RBS form only (e.g., `def foo: (String) -> Integer`).
15
+ - If you need to document parameters or returns, place brief comments above the signature lines using `#` and keep them RBS-friendly (no `@param` / `@return` tags from YARD).
16
+
17
+ Examples:
18
+
19
+ Valid (RBS):
20
+
21
+ ```
22
+ module Foo
23
+ # Runs tasks
24
+ def self.run: () -> void
25
+ end
26
+ ```
27
+
28
+ Invalid (not allowed in .rbs):
29
+
30
+ ```
31
+ # Ruby syntax – not RBS
32
+ class << self
33
+ def run: () -> void
34
+ end
35
+
36
+ # Not supported across RBS versions; avoid in this project
37
+ module self
38
+ def run: () -> void
39
+ end
40
+
41
+ # Heredocs or any Ruby bodies are not allowed in .rbs
42
+ def self.run: () -> void
43
+ <<~DOC
44
+ DOC
45
+ end
46
+ ```
47
+
48
+ Enforcement:
49
+ - CI and local builds may parse `.rbs` files during gem install or doc generation. Any non-RBS syntax can cause installation to fail. Keep `.rbs` clean to avoid such failures.
@@ -0,0 +1,132 @@
1
+ Project: kettle-dev — Development Guidelines (for advanced contributors)
2
+
3
+ This document captures project-specific knowledge to streamline setup, testing, and ongoing development.
4
+
5
+ 1. Build and configuration
6
+ - ENV is controlled by `direnv`.
7
+ - Two files are loaded:
8
+ - .envrc — environment variables for local development, committed to source control
9
+ - .env.local — environment variables that are not committed to source control. These setting override .envrc.
10
+ - Run `direnv allow` after making changes to .envrc or .env.local.
11
+ - See .envrc for details.
12
+ - See .env.local.example for an example of what to put in .env.local.
13
+ - See CONTRIBUTING.md for details on how to set up your local environment.
14
+ - Ruby and Bundler
15
+ - Runtime supports very old Rubies (>= 1.9.2) but development tooling targets >= 2.3 because of CI/setup-ruby and dev dependencies.
16
+ - Use a recent Ruby (>= 3.1 recommended) for fastest setup and to exercise modern coverage behavior.
17
+ - Install dependencies via Bundler in project root:
18
+ - bundle install
19
+ - Rake tasks (preferred entry points)
20
+ - The Rakefile wires common workflows. Useful targets:
21
+ - rake spec — run RSpec suite (also aliased via rake test)
22
+ - rake coverage — run specs with coverage locally and open a report (requires kettle-soup-cover)
23
+ - rake rubocop_gradual:autocorrect — RuboCop-LTS Gradual, with autocorrect as default task
24
+ - rake reek and rake reek:update — code smell checks and persisted snapshots in REEK
25
+ - rake yard — generate YARD docs for lib and selected extra files
26
+ - rake bundle:audit and rake bundle:audit:update — dependency vulnerability checks
27
+ - rake build / rake release — gem build/release helper tasks (Bundler + stone_checksums)
28
+ - The default rake target runs a curated set of tasks; this varies for CI vs local (see CI env var logic in Rakefile).
29
+ - Always run the default rake task prior commits, and after making changes to lib/ code, or *.md files, to allow the linter to autocorrect, and to generate updated documentation.
30
+ - Coverage orchestration
31
+ - Coverage is controlled by kettle-soup-cover and .simplecov. Thresholds (line and branch) are enforced and can fail the process.
32
+ - Thresholds are primarily controlled by environment variables (see .simplecov and comments therein) typically loaded via direnv (.envrc) and CI workflow (.github/workflows/coverage.yml). When running only a test subset, thresholds may fail; see Testing below.
33
+ - Gem signing (for releases)
34
+ - Signing is enabled unless SKIP_GEM_SIGNING is set. If enabled and certificates are present (certs/<USER>.pem), gem build will attempt to sign using ~/.ssh/gem-private_key.pem.
35
+ - See CONTRIBUTING.md for releasing details; use SKIP_GEM_SIGNING when building in environments without the private key.
36
+ - Important for local testing (to avoid hanging prompts): ALWAYS skip signing when building locally to test the packaging or install process. Without the private key password, the build will wait indefinitely at a signing prompt.
37
+ - One-off commands (recommended):
38
+ - SKIP_GEM_SIGNING=true gem build kettle-dev.gemspec
39
+ - SKIP_GEM_SIGNING=true bundle exec rake build
40
+ - SKIP_GEM_SIGNING=true bundle exec rake release # only to test workflow; do not actually push
41
+ - direnv option (optional, not recommended globally): add `export SKIP_GEM_SIGNING=true` to your .env.local when you know you won’t be signing in this environment.
42
+ - Remove or unset SKIP_GEM_SIGNING when performing a real, signed release in the environment that has the private key.
43
+
44
+ 2. Testing
45
+ - Framework and helpers
46
+ - RSpec 3.13 with custom spec/spec_helper.rb configuration:
47
+ - silent_stream: STDOUT is silenced by default for examples to keep logs clean.
48
+ - To explicitly test console output, tag the example or group with :check_output.
49
+ - Global state hygiene: Around each example, FlossFunding.namespaces and FlossFunding.silenced are snapshotted and restored to prevent cross-test pollution.
50
+ - DEBUG toggle: Set DEBUG=true to require 'debug' and avoid silencing output during your run.
51
+ - ENV seeding: The suite sets ENV["FLOSS_FUNDING_FLOSS_FUNDING"] = "Free-as-in-beer" so that the library’s own namespace is considered activated (avoids noisy warnings).
52
+ - Coverage: kettle-soup-cover integrates SimpleCov; .simplecov is invoked from spec_helper when enabled by Kettle::Soup::Cover::DO_COV, which is controlled by K_SOUP_COV_DO being set to true / false.
53
+ - RSpec.describe usage:
54
+ - Use `describe "#<method_name>"` to contain a block of specs that test instance method behavior.
55
+ - Use `describe "::<method_name>"` to contain a block of specs that test class method behavior.
56
+ - Do not use `describe ".<method_name>"` because the dot is ambiguous w.r.t instance vs. class methods.
57
+ - When adding new code or modifying existing code always add tests to cover the updated behavior, including branches, and different types of expected and unexpected inputs.
58
+ - Additional test utilities:
59
+ - rspec-stubbed_env: Use stub_env to control ENV safely within examples.
60
+ - timecop-rspec: Time manipulation available, see lib/kettle/test/config/int/rspec/timecop_rspec.
61
+ - Running tests (verified)
62
+ - Full suite (recommended to satisfy coverage thresholds):
63
+ - bin/rspec
64
+ - or: bundle exec rspec
65
+ - or: bundle exec rake spec
66
+ - Progress format (less verbose):
67
+ - bundle exec rspec --format progress
68
+ - Focused runs
69
+ - You can run a single file or example, but note: coverage thresholds need to be disabled with K_SOUP_COV_MIN_HARD=false
70
+ - Example: K_SOUP_COV_MIN_HARD=false bin/rspec spec/kettle-dev/class_spec.rb:42
71
+ - Output visibility
72
+ - To see STDOUT from the code under test, use the :check_output tag on the example or group.
73
+ Example:
74
+ RSpec.describe "output", :check_output do
75
+ it "prints" do
76
+ puts "This output should be visible"
77
+ expect(true).to be true
78
+ end
79
+ end
80
+ - Alternatively, run with DEBUG=true to disable silencing for the entire run.
81
+ - During a spec run, the presence of output about missing activation keys is often expected, since it is literally what this library is for. It only indicates a failure if the spec expected all activation keys to be present, and not all specs do.
82
+ - Adding new tests (guidelines)
83
+ - Organize specs by class/module. Do not create per-task umbrella spec files; add examples to the existing spec for the class/module under test, or create a new spec file for that class/module if one does not exist. Only create a standalone scenario spec when it intentionally spans multiple classes for an integration/benchmark scenario (e.g., bench_integration_spec), and name it accordingly.
84
+ - Spec file names must map to a real class or module under lib/ (mirror the path). Do not introduce specs for non-existent classes or ad-hoc names (e.g., avoid template_helpers_replacements_spec.rb when testing Kettle::Dev::TemplateHelpers; add those examples to template_helpers_spec.rb).
85
+ - REQUIRED: Provide unit tests for every class, module, constant, and public method. Place them in spec/ mirroring the path under lib/. When a file under lib/ is added or changed, ensure a corresponding spec file exists/updated for it.
86
+ - Add tests for all public methods and add contexts for variations of their arguments, and arity.
87
+ - This repository targets near-100% coverage of its public API; when you add new public methods, rake tasks to a rakelib, or config behavior, add or update specs accordingly.
88
+ - Place new specs under spec/ mirroring lib/ structure where possible. Do not require "spec_helper" at the top of spec files, as it is automatically loaded by .rspec.
89
+ - If your code relies on environment variables that drive activation (see "Activation env vars" below), prefer using rspec-stubbed_env:
90
+ - it does not support stubbing with blocks, but it does automatically clean up after itself.
91
+ - outside the example:
92
+ include_context 'with stubbed env'
93
+ - in a before hook, or in an example:
94
+ stub_env("FLOSS_FUNDING_MY_NS" => "Free-as-in-beer")
95
+ # example code continues
96
+ - If your spec needs to assert on console output, tag it with :check_output. By default, STDOUT is silenced.
97
+ - Use Timecop for deterministic time-sensitive behavior as needed (require config/timecop is already done by spec_helper).
98
+
99
+ - Types and documentation
100
+ - REQUIRED: All public APIs must have RBS type signatures checked into sig/ under the corresponding path. When you add a new public method or change a signature, update the matching .rbs file.
101
+ - REQUIRED: All public methods must include inline YARD docs with @param/@return (and @yield/@option where applicable). Generate docs with `bundle exec rake yard` to verify formatting.
102
+
103
+ 3. Additional development information
104
+ - Code style and static analysis
105
+ - RuboCop-LTS (Gradual) is integrated. Use:
106
+ - bundle exec rake rubocop_gradual:autocorrect
107
+ - bundle exec rake rubocop_gradual:force_update # only run if there are still linting violations the default rake task, which includes autocorrect locally, or a standalone autocorrect task, has run, and failed, and the violations won't be fixed
108
+ - Reek is configured to scan {lib,spec,tests}/**/*.rb. Use:
109
+ - bundle exec rake reek
110
+ - bundle exec rake reek:update # writes current output to REEK, fails on smells
111
+ - Keep REEK file updated with intentional smells snapshot when appropriate (e.g., after refactors).
112
+ - Locally, the default rake task includes reek:update.
113
+ - Documentation
114
+ - Generate YARD docs with: bundle exec rake yard. It includes lib/**/*.rb and extra docs like README.md, CHANGELOG.md, RUBOCOP.md, REEK, etc.
115
+ - Appraisal and multi-gemfile testing
116
+ - appraisal2 is present to manage multiple dependency sets; see Appraisals and gemfiles/modular/*.gemfile. If you need to verify against alternate dependency versions, use Appraisal to install and run rspec under those Gemfiles.
117
+ - You can run a single github workflow by running `act -W /github/workflows/<workflow name>.yml`
118
+ - CI/local differences and defaults
119
+ - The Rakefile adjusts default tasks based on CI env var. Locally, rake default may include coverage, reek:update, yard, etc. On CI, it tends to just run spec.
120
+
121
+ Quick start
122
+ 1) bundle install
123
+ 2) K_SOUP_COV_FORMATTERS="xml,rcov,lcov,json" bin/rspec (generates coverage reports in coverage/ in the specified formats, only choose the formats you need)
124
+ 3) Optional local HTML coverage report: K_SOUP_COV_FORMATTERS="html" bin/rspec (generates HTML coverage report in coverage/ - but this is too verbose for AI, so Junie should use one of the more terse formats, like rcov, lcov, or json)
125
+ 4) Static analysis: bundle exec rake rubocop_gradual:check && bundle exec rake reek
126
+
127
+ Notes
128
+ - ALWAYS Run bundle exec rake rubocop_gradual:autocorrect as the final step before completing a task, to lint and autocorrect any remaining issues. Then if there are new lint failures, attempt to correct them manually.
129
+ - NEVER run vanilla rubocop, as it won't handle the linting config properly. Always run rubocop_gradual:autocorrect or rubocop_gradual.
130
+ - Running only a subset of specs is supported but in order to bypass the hard failure due to coverage thresholds, you need to run with K_SOUP_COV_MIN_HARD=false.
131
+ - When adding code that writes to STDOUT, remember most specs silence output unless tagged with :check_output or DEBUG=true.
132
+ - For all the kettle-soup-cover options, see .envrc and find the K_SOUP_COV_* env vars.
@@ -0,0 +1,3 @@
1
+ collective: "kettle-rb"
2
+ readme-backers-commit-subject: "💸 Thanks 🙏 to our new backers 🎒 and subscribers 📜"
3
+ readme-osc-tag: "OPENCOLLECTIVE"
data/.qlty/qlty.toml ADDED
@@ -0,0 +1,79 @@
1
+ # For a guide to configuration, visit https://qlty.sh/d/config
2
+ # Or for a full reference, visit https://qlty.sh/d/qlty-toml
3
+ config_version = "0"
4
+
5
+ exclude_patterns = [
6
+ "*_min.*",
7
+ "*-min.*",
8
+ "*.min.*",
9
+ "**/.yarn/**",
10
+ "**/*.d.ts",
11
+ "**/assets/**",
12
+ "**/bin/**",
13
+ "**/bower_components/**",
14
+ "**/build/**",
15
+ "**/cache/**",
16
+ "**/config/**",
17
+ "**/.devcontainer",
18
+ "**/db/**",
19
+ "**/deps/**",
20
+ "**/dist/**",
21
+ "**/doc/**",
22
+ "**/docs/**",
23
+ "**/extern/**",
24
+ "**/external/**",
25
+ "**/generated/**",
26
+ "**/Godeps/**",
27
+ "**/gradlew/**",
28
+ "**/mvnw/**",
29
+ "**/node_modules/**",
30
+ "**/protos/**",
31
+ "**/seed/**",
32
+ "**/target/**",
33
+ "**/templates/**",
34
+ "**/testdata/**",
35
+ "**/vendor/**",
36
+ ".github/workflows/codeql-analysis.yml"
37
+ ]
38
+
39
+ test_patterns = [
40
+ "**/test/**",
41
+ "**/spec/**",
42
+ "**/*.test.*",
43
+ "**/*.spec.*",
44
+ "**/*_test.*",
45
+ "**/*_spec.*",
46
+ "**/test_*.*",
47
+ "**/spec_*.*",
48
+ ]
49
+
50
+ [smells]
51
+ mode = "comment"
52
+
53
+ [smells.boolean_logic]
54
+ threshold = 4
55
+ enabled = true
56
+
57
+ [smells.file_complexity]
58
+ threshold = 55
59
+ enabled = false
60
+
61
+ [smells.return_statements]
62
+ threshold = 4
63
+ enabled = true
64
+
65
+ [smells.nested_control_flow]
66
+ threshold = 4
67
+ enabled = true
68
+
69
+ [smells.function_parameters]
70
+ threshold = 4
71
+ enabled = true
72
+
73
+ [smells.function_complexity]
74
+ threshold = 5
75
+ enabled = true
76
+
77
+ [smells.duplication]
78
+ enabled = true
79
+ threshold = 20
data/.rspec ADDED
@@ -0,0 +1,8 @@
1
+ --format progress
2
+ --color
3
+ --require spec_helper
4
+ --warnings
5
+ --format html
6
+ --out results/test_results.html
7
+ --format RspecJunitFormatter
8
+ --out results/test_results.xml
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ inherit_gem:
2
+ rubocop-lts: config/rubygem_rspec.yml
3
+
4
+ plugins: rubocop-on-rbs
5
+
6
+ RBS:
7
+ Enabled: true
8
+
9
+ Layout/IndentationConsistency:
10
+ Exclude: ['*.md']
11
+
12
+ RSpec/ExampleLength:
13
+ Enabled: false
data/.simplecov ADDED
@@ -0,0 +1,7 @@
1
+ require "kettle/soup/cover/config"
2
+
3
+ # Minimum coverage thresholds are set by kettle-soup-cover.
4
+ # It is controlled by ENV variables, which are set in .envrc and loaded via `direnv allow`
5
+ # If the values for minimum coverage need to change, they should be changed both there,
6
+ # and in 2 places in .github/workflows/coverage.yml.
7
+ SimpleCov.start
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.4.5
@@ -0,0 +1,22 @@
1
+ # Gratefully and liberally taken from the MIT-licensed https://github.com/bensheldon/good_job/pull/113/files
2
+ require "kramdown"
3
+ require "kramdown-parser-gfm"
4
+
5
+ # Custom markup provider class that always renders Kramdown using GFM (Github Flavored Markdown).
6
+ # GFM is needed to render markdown tables and fenced code blocks in the README.
7
+ class KramdownGfmDocument < Kramdown::Document
8
+ def initialize(source, options = {})
9
+ options[:input] = "GFM" unless options.key?(:input)
10
+ super(source, options)
11
+ end
12
+ end
13
+
14
+ # Insert the new provider as the highest priority option for Markdown.
15
+ # See:
16
+ # - https://github.com/lsegal/yard/issues/1157
17
+ # - https://github.com/lsegal/yard/issues/1017
18
+ # - https://github.com/lsegal/yard/blob/main/lib/yard/templates/helpers/markup_helper.rb
19
+ YARD::Templates::Helpers::MarkupHelper::MARKUP_PROVIDERS[:markdown].insert(
20
+ 0,
21
+ {const: "KramdownGfmDocument"},
22
+ )
data/.yardopts ADDED
@@ -0,0 +1,11 @@
1
+ --plugin junk
2
+ --plugin relative_markdown_links
3
+ --readme README.md
4
+ --charset utf-8
5
+ --markup markdown
6
+ --output docs
7
+ --load .yard_gfm_support.rb
8
+ 'lib/**/*.rb'
9
+ -
10
+ '*.md'
11
+ '*.txt'
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ source "https://rubygems.org"
6
+
7
+ # Appraisal Root Gemfile is for running appraisal to generate the Appraisal Gemfiles
8
+ # in gemfiles/*gemfile.
9
+ # On CI, we use it for the Appraisal-based builds.
10
+ # We do not load the standard Gemfile, as it is tailored for local development.
11
+
12
+ gemspec
data/Appraisals ADDED
@@ -0,0 +1,120 @@
1
+ # frozen_string_literal: true
2
+
3
+ # HOW TO UPDATE APPRAISALS:
4
+ # BUNDLE_GEMFILE=Appraisal.root.gemfile bundle
5
+ # BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update
6
+ # bundle exec rake rubocop_gradual:autocorrect
7
+
8
+ # Lock/Unlock Deps Pattern
9
+ #
10
+ # Two often conflicting goals resolved!
11
+ #
12
+ # - unlocked_deps.yml
13
+ # - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
14
+ # - Uses an Appraisal2 "unlocked_deps" gemfile, and the current MRI Ruby release
15
+ # - Know when new dependency releases will break local dev with unlocked dependencies
16
+ # - Broken workflow indicates that new releases of dependencies may not work
17
+ #
18
+ # - locked_deps.yml
19
+ # - All runtime & dev dependencies, and has a `Gemfile.lock` committed
20
+ # - Uses the project's main Gemfile, and the current MRI Ruby release
21
+ # - Matches what contributors and maintainers use locally for development
22
+ # - Broken workflow indicates that a new contributor will have a bad time
23
+ #
24
+ appraise "unlocked_deps" do
25
+ gem "erb"
26
+ eval_gemfile "modular/coverage.gemfile"
27
+ eval_gemfile "modular/documentation.gemfile"
28
+ eval_gemfile "modular/style.gemfile"
29
+ end
30
+
31
+ # Used for head (nightly) releases of ruby, truffleruby, and jruby.
32
+ # Split into discrete appraisals if one of them needs a dependency locked discretely.
33
+ appraise "head" do
34
+ gem "erb"
35
+ gem "mutex_m", ">= 0.2"
36
+ gem "stringio", ">= 3.0"
37
+ gem "benchmark", "~> 0.4", ">= 0.4.1"
38
+ end
39
+
40
+ # Used for current releases of ruby, truffleruby, and jruby.
41
+ # Split into discrete appraisals if one of them needs a dependency locked discretely.
42
+ appraise "current" do
43
+ gem "erb"
44
+ gem "mutex_m", ">= 0.2"
45
+ gem "stringio", ">= 3.0"
46
+ end
47
+
48
+ appraise "ruby-2-3" do
49
+ # The cake is a lie. erb v2.2, the oldest release on RubyGems.org, was never compatible with Ruby 2.3.
50
+ # This means we have no choice but to use the erb that shipped with Ruby 2.3
51
+ # /opt/hostedtoolcache/Ruby/2.3.8/x64/lib/ruby/gems/2.3.0/gems/erb-2.2.2/lib/erb.rb:670:in `prepare_trim_mode': undefined method `match?' for "-":String (NoMethodError)
52
+ # spec.add_development_dependency("erb", ">= 2.2") # ruby >= 2.3.0, not SemVer, old rubies get dropped in a patch.
53
+ end
54
+
55
+ appraise "ruby-2-4" do
56
+ gem "erb"
57
+ end
58
+
59
+ appraise "ruby-2-5" do
60
+ gem "erb"
61
+ end
62
+
63
+ appraise "ruby-2-6" do
64
+ gem "erb"
65
+ gem "mutex_m", "~> 0.2"
66
+ gem "stringio", "~> 3.0"
67
+ end
68
+
69
+ appraise "ruby-2-7" do
70
+ gem "erb"
71
+ gem "mutex_m", "~> 0.2"
72
+ gem "stringio", "~> 3.0"
73
+ end
74
+
75
+ appraise "ruby-3-0" do
76
+ gem "erb"
77
+ gem "mutex_m", "~> 0.2"
78
+ gem "stringio", "~> 3.0"
79
+ end
80
+
81
+ appraise "ruby-3-1" do
82
+ gem "erb"
83
+ gem "mutex_m", "~> 0.2"
84
+ gem "stringio", "~> 3.0"
85
+ end
86
+
87
+ appraise "ruby-3-2" do
88
+ gem "erb"
89
+ gem "mutex_m", "~> 0.2"
90
+ gem "stringio", "~> 3.0"
91
+ end
92
+
93
+ appraise "ruby-3-3" do
94
+ gem "erb"
95
+ gem "mutex_m", "~> 0.2"
96
+ gem "stringio", "~> 3.0"
97
+ end
98
+
99
+ # Only run security audit on latest Ruby version
100
+ appraise "audit" do
101
+ gem "erb"
102
+ gem "mutex_m", "~> 0.2"
103
+ gem "stringio", "~> 3.0"
104
+ end
105
+
106
+ # Only run coverage on latest Ruby version
107
+ appraise "coverage" do
108
+ gem "erb"
109
+ gem "mutex_m", "~> 0.2"
110
+ gem "stringio", "~> 3.0"
111
+ eval_gemfile "modular/coverage.gemfile"
112
+ end
113
+
114
+ # Only run linter on latest Ruby version (but, in support of oldest supported Ruby version)
115
+ appraise "style" do
116
+ gem "erb"
117
+ gem "mutex_m", "~> 0.2"
118
+ gem "stringio", "~> 3.0"
119
+ eval_gemfile "modular/style.gemfile"
120
+ end