Skip to content

Commit 38c88bb

Browse files
committed
➕ kettle-dev
1 parent b19d904 commit 38c88bb

File tree

188 files changed

+6328
-2748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+6328
-2748
lines changed

.devcontainer/devcontainer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3+
{
4+
"name": "Ruby",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/ruby:1-3-bookworm",
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
// "postCreateCommand": "ruby --version",
16+
17+
// Configure tool-specific properties.
18+
"customizations" : {
19+
"jetbrains" : {
20+
"backend" : "RubyMine"
21+
}
22+
},
23+
24+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
25+
// "remoteUser": "root"
26+
}

.env.local.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# DO NOT EDIT THIS FILE
3+
#
4+
# COPT THIS FILE TO .env.local
5+
#
6+
# That file is ignored by .gitignore. This file is not.
7+
#
8+
export DEBUG=false # do not allow byebug statements (override in .env.local)
9+
export FLOSS_FUNDING_DEBUG=false # extra logging to help diagnose issues (override in .env.local)
10+
export AUTOGEN_FIXTURE_CLEANUP=false # autogenerated gem fixture cleanup after every RSpec run
11+
export GIT_HOOK_FOOTER_APPEND=false
12+
export GIT_HOOK_FOOTER_APPEND_DEBUG=false
13+
export GIT_HOOK_FOOTER_SENTINEL="⚡️ A message from a fellow meat-based-AI ⚡️"
14+
export GITHUB_TOKEN=<your GH PAT, for the GHA console bin/rake ci:act - DO NOT EVER COMMIT IT>

.envrc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Run any command in this library's bin/ without the bin/ prefix!
2+
# Prefer exe version over binstub
3+
PATH_add exe
4+
PATH_add bin
5+
6+
# Only add things to this file that should be shared with the team.
7+
8+
# **dotenv** (See end of file for .env.local integration)
9+
# .env would override anything in this file, if enabled.
10+
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments.
11+
# Override and customize anything below in your own .env.local
12+
# If you are using dotenv and not direnv,
13+
# copy the following `export` statements to your own .env file.
14+
15+
### General Ruby ###
16+
# Turn off Ruby Warnings about deprecated code
17+
# export RUBYOPT="-W0"
18+
19+
### External Testing Controls
20+
export K_SOUP_COV_DO=true # Means you want code coverage
21+
export K_SOUP_COV_COMMAND_NAME="Test Coverage"
22+
# Available formats are html, xml, rcov, lcov, json, tty
23+
export K_SOUP_COV_FORMATTERS="html,xml,rcov,lcov,json,tty"
24+
export K_SOUP_COV_MIN_BRANCH=68 # Means you want to enforce X% branch coverage
25+
export K_SOUP_COV_MIN_LINE=90 # Means you want to enforce X% line coverage
26+
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
27+
export K_SOUP_COV_MULTI_FORMATTERS=true
28+
export K_SOUP_COV_OPEN_BIN= # Means don't try to open coverage results in browser
29+
export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage
30+
export KETTLE_TEST_SILENT=true
31+
32+
# Internal Debugging Controls
33+
export DEBUG=false # do not allow byebug statements (override in .env.local)
34+
export FLOSS_CFG_FUND_DEBUG=false # extra logging to help diagnose issues (override in .env.local)
35+
export FLOSS_CFG_FUND_LOGFILE=tmp/log/debug.log
36+
37+
# Concurrently developing the rubocop-lts suite?
38+
export RUBOCOP_LTS_LOCAL=false
39+
40+
# .env would override anything in this file, if `dotenv` is uncommented below.
41+
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments,
42+
# and that is why we generally want to leave it commented out.
43+
# dotenv
44+
45+
# .env.local will override anything in this file.
46+
dotenv_if_exists .env.local

.git-hooks/commit-msg

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env ruby
2+
# vim: set syntax=ruby
3+
4+
# Do not rely on Bundler; allow running outside a Bundler context
5+
begin
6+
require "rubygems"
7+
rescue LoadError
8+
# continue
9+
end
10+
11+
begin
12+
# External gems
13+
require "gitmoji/regex"
14+
15+
full_text = File.read(ARGV[0])
16+
# Is the first character a GitMoji?
17+
gitmoji_index = full_text =~ Gitmoji::Regex::REGEX
18+
if gitmoji_index == 0
19+
exit 0
20+
else
21+
denied = <<EOM
22+
Oh snap, think again...
23+
24+
______ _______ ___ _______ _______ _______ _______ ______ __
25+
| _ | | | | || || || || || | | |
26+
| | || | ___| | || ___|| ||_ _|| ___|| _ || |
27+
| |_||_ | |___ | || |___ | | | | | |___ | | | || |
28+
| __ || ___| ___| || ___|| _| | | | ___|| |_| ||__|
29+
| | | || |___ | || |___ | |_ | | | |___ | | __
30+
|___| |_||_______||_______||_______||_______| |___| |_______||______| |__|
31+
32+
33+
Did you forget to add a relevant gitmoji? (see https://gitmoji.dev/ for tools)
34+
In this project, a Gitmoji must be the first grapheme of the commit message.
35+
What's a grapheme?
36+
A symbol rendered to be visually identifiable as a single character, but which may be composed of multiple Unicode code points)
37+
Must match: #{Gitmoji::Regex::REGEX.to_s}
38+
#{gitmoji_index ? "Found a gitmoji at character index #{gitmoji_index}... not good enough.\n" : ""}
39+
Example: git commit -m "✨ My excellent new feature"
40+
41+
EOM
42+
puts denied
43+
exit 1
44+
end
45+
rescue LoadError => e
46+
warn("gitmoji-regex gem not found: #{e.class}: #{e.message}.\n\tInstall the 'gitmoji-regex' gem to enable this check.\n\tSkipping gitmoji check.")
47+
end
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
🔖 Prepare release v
2+
🔒️ Checksums for v
3+
4+
# Lines beginning with # are ignored.
5+
# This file is read by .git-hooks/prepare-commit-msg in each project.
6+
# Each line of this file will be matched against the commit subject using `starts_with?`.
7+
# If any `starts_with?` match the project script bin/prepare-commit-msg will run.
8+
# 🔒️ Checksums for v is the standard commit message by stone_checksums.

.git-hooks/footer-template.erb.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
⚡️ A message from a fellow meat-based-AI ⚡️
2+
- [❤️] Finely-crafted open-source tools like <%= @gem_name %> (& many more) are a full-time endeavor.
3+
- [❤️] Though I adore my work, it lacks financial sustainability.
4+
- [❤️] Please, help me continue enhancing your tools by becoming a sponsor:
5+
- [💲] https://liberapay.com/pboling/donate
6+
- [💲] https://github.com/sponsors/pboling
7+
8+
<% if ENV["GIT_HOOK_FOOTER_APPEND_DEBUG"] == "true" %>
9+
@pwd = <%= @pwd %>
10+
@gemspecs = <%= @gemspecs %>
11+
@spec = <%= @spec %>
12+
@gemspec_path = <%= @gemspec_path %>
13+
@gem_name <%= @gem_name %>
14+
@spec_name <%= @spec_name %>
15+
@content <%= @content %>
16+
<% end %>

.git-hooks/prepare-commit-msg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
# Fail on error and unset variables
4+
set -eu
5+
6+
# Determine project root as the parent directory of this hook script
7+
PROJECT_ROOT="$(CDPATH= cd -- "$(dirname -- "$0")"/.. && pwd)"
8+
9+
# Run the Ruby hook within the direnv context (if available),
10+
# so ENV from .envrc/.env.local at project root is loaded.
11+
# One of the things .envrc needs to do is add $PROJECT_ROOT/bin/ to the path.
12+
# You should have this line at the top of .envrc
13+
# PATH_add bin
14+
# NOTE: If this project ships exe scripts it should also add that.
15+
if command -v direnv >/dev/null 2>&1; then
16+
exec direnv exec "$PROJECT_ROOT" "kettle-commit-msg" "$@"
17+
else
18+
raise "direnv not found. Local development of this project ($PROJECT_ROOT) with tools from the kettle-dev gem may not work properly. Please run 'brew install direnv'."
19+
fi

.github/FUNDING.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# These are supported funding model platforms
22

3+
buy_me_a_coffee: pboling
4+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
35
github: [pboling] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: galtzo # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6+
issuehunt: pboling # Replace with a single IssueHunt username
67
ko_fi: pboling # Replace with a single Ko-fi username
7-
tidelift: rubygems/oauth # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
98
liberapay: pboling # Replace with a single Liberapay username
10-
issuehunt: pboling # Replace with a single IssueHunt username
11-
otechie: # Replace with a single Otechie username
12-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
9+
open_collective: ruby-oauth
10+
patreon: galtzo # Replace with a single Patreon username
11+
polar: pboling
12+
thanks_dev: u/gh/pboling
13+
tidelift: rubygems/oauth

.github/dependabot.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ updates:
33
- package-ecosystem: bundler
44
directory: "/"
55
schedule:
6-
interval: daily
7-
time: "04:30"
8-
open-pull-requests-limit: 10
6+
interval: "weekly"
7+
open-pull-requests-limit: 5
98
ignore:
109
- dependency-name: "rubocop-lts"
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"

.github/workflows/ancient.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: MRI 2.3, 2.4, 2.5 (EOL)
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- 'main'
10+
- '*-stable'
11+
tags:
12+
- '!*' # Do not execute on tags
13+
pull_request:
14+
branches:
15+
- '*'
16+
# Allow manually triggering the workflow.
17+
workflow_dispatch:
18+
19+
# Cancels all previous workflow runs for the same branch that have not yet completed.
20+
concurrency:
21+
# The concurrency group contains the workflow name and the branch name.
22+
group: "${{ github.workflow }}-${{ github.ref }}"
23+
cancel-in-progress: true
24+
25+
jobs:
26+
test:
27+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
28+
name: Specs ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
29+
runs-on: ubuntu-22.04
30+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
31+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
32+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
include:
37+
# Ruby 2.3
38+
- ruby: "ruby-2.3"
39+
appraisal: "ruby-2-3"
40+
exec_cmd: "rake test"
41+
gemfile: "Appraisal.root"
42+
rubygems: "3.3.27"
43+
bundler: "2.3.27"
44+
45+
# Ruby 2.4
46+
- ruby: "ruby-2.4"
47+
appraisal: "ruby-2-4"
48+
exec_cmd: "rake test"
49+
gemfile: "Appraisal.root"
50+
rubygems: "3.3.27"
51+
bundler: "2.3.27"
52+
53+
# Ruby 2.5
54+
- ruby: "ruby-2.5"
55+
appraisal: "ruby-2-5"
56+
exec_cmd: "rake test"
57+
gemfile: "Appraisal.root"
58+
rubygems: "3.3.27"
59+
bundler: "2.3.27"
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v5
64+
65+
- name: Setup Ruby & RubyGems
66+
uses: ruby/setup-ruby@v1
67+
with:
68+
ruby-version: ${{ matrix.ruby }}
69+
rubygems: ${{ matrix.rubygems }}
70+
bundler: ${{ matrix.bundler }}
71+
bundler-cache: false
72+
73+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
74+
# We need to do this first to get appraisal installed.
75+
# NOTE: This does not use the primary Gemfile at all.
76+
- name: Install Root Appraisal
77+
run: bundle
78+
- name: Appraisal for ${{ matrix.appraisal }}
79+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
80+
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
81+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

0 commit comments

Comments
 (0)