Skip to content

Commit bff58e1

Browse files
authored
Merge pull request #690 from ruby-oauth/feat/yard-fence
2 parents 415f70d + 6037dad commit bff58e1

File tree

83 files changed

+3064
-3646
lines changed

Some content is hidden

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

83 files changed

+3064
-3646
lines changed

.git-hooks/commit-msg

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,39 @@ begin
1616
# Is the first character a GitMoji?
1717
gitmoji_index = full_text =~ Gitmoji::Regex::REGEX
1818
if gitmoji_index == 0
19-
exit 0
19+
exit(0)
2020
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
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}
38+
#{"Found a gitmoji at character index #{gitmoji_index}... not good enough.\n" if gitmoji_index}
39+
Example: git commit -m "✨ My excellent new feature"
40+
41+
EOM
4242
puts denied
43-
exit 1
43+
exit(1)
4444
end
4545
rescue LoadError => e
46-
warn("gitmoji-regex gem not found: #{e.class}: #{e.message}.\n\tSkipping gitmoji check and allowing commit to proceed.\n\tRecommendation: add 'gitmoji-regex' to your development dependencies to enable this check.")
47-
exit 0
46+
failure = <<~EOM
47+
gitmoji-regex gem not found: #{e.class}: #{e.message}.
48+
Skipping gitmoji check and allowing commit to proceed.
49+
Recommendation: add 'gitmoji-regex' to your development dependencies to enable this check.
50+
51+
EOM
52+
warn(failure)
53+
exit(0)
4854
end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
⚡️ A message from a fellow meat-based-AI ⚡️
2-
- [❤️] Finely-crafted open-source tools like <%= @gem_name %> (& many more) are a full-time endeavor.
2+
- [❤️] Finely-crafted open-source tools like <%= @gem_name %> (& many more) require time and effort.
33
- [❤️] Though I adore my work, it lacks financial sustainability.
44
- [❤️] Please, help me continue enhancing your tools by becoming a sponsor:
55
- [💲] https://liberapay.com/pboling/donate

.git-hooks/prepare-commit-msg

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@
33
# Fail on error and unset variables
44
set -eu
55

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
6+
# We are not using direnv exec here because mise and direnv can result in conflicting PATH settings:
7+
# See: https://mise.jdx.dev/direnv.html
8+
exec "kettle-commit-msg" "$@"

.github/workflows/current.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ jobs:
6363

6464
steps:
6565
- name: Checkout
66-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
66+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
6767
uses: actions/checkout@v5
6868

6969
- name: Setup Ruby & RubyGems
70-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
70+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
7171
uses: ruby/setup-ruby@v1
7272
with:
7373
ruby-version: ${{ matrix.ruby }}
@@ -79,11 +79,37 @@ jobs:
7979
# We need to do this first to get appraisal installed.
8080
# NOTE: This does not use the primary Gemfile at all.
8181
- name: Install Root Appraisal
82-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
82+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
8383
run: bundle
84-
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
85-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
84+
85+
- name: "[Attempt 1] Install Root Appraisal"
86+
id: bundleAttempt1
87+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
88+
run: bundle
89+
# Continue to the next step on failure
90+
continue-on-error: true
91+
92+
# Effectively an automatic retry of the previous step.
93+
- name: "[Attempt 2] Install Root Appraisal"
94+
id: bundleAttempt2
95+
# If bundleAttempt1 failed, try again here; Otherwise skip.
96+
if: ${{ steps.bundleAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
97+
run: bundle
98+
99+
- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
100+
id: bundleAppraisalAttempt1
101+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
102+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
103+
# Continue to the next step on failure
104+
continue-on-error: true
105+
106+
# Effectively an automatic retry of the previous step.
107+
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
108+
id: bundleAppraisalAttempt2
109+
# If bundleAppraisalAttempt1 failed, try again here; Otherwise skip.
110+
if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
86111
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
87-
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
88-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
112+
113+
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
114+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
89115
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/dep-heads.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ jobs:
4747
rubygems: latest
4848
bundler: latest
4949

50-
# truffleruby-24.1
51-
# (according to documentation: targets Ruby 3.3 compatibility)
52-
# (according to runtime: targets Ruby 3.2 compatibility)
50+
# truffleruby-24.1 (targets Ruby 3.3 compatibility)
5351
- ruby: "truffleruby"
5452
appraisal: "dep-heads"
5553
exec_cmd: "rake test"
@@ -67,11 +65,11 @@ jobs:
6765

6866
steps:
6967
- name: Checkout
70-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
68+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
7169
uses: actions/checkout@v5
7270

7371
- name: Setup Ruby & RubyGems
74-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
72+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
7573
uses: ruby/setup-ruby@v1
7674
with:
7775
ruby-version: ${{ matrix.ruby }}
@@ -82,24 +80,38 @@ jobs:
8280
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
8381
# We need to do this first to get appraisal installed.
8482
# NOTE: This does not use the primary Gemfile at all.
85-
- name: "Install Root Appraisal"
86-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
83+
- name: Install Root Appraisal
84+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
8785
run: bundle
8886

89-
- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
90-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
87+
- name: "[Attempt 1] Install Root Appraisal"
9188
id: bundleAttempt1
89+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
90+
run: bundle
91+
# Continue to the next step on failure
92+
continue-on-error: true
93+
94+
# Effectively an automatic retry of the previous step.
95+
- name: "[Attempt 2] Install Root Appraisal"
96+
id: bundleAttempt2
97+
# If bundleAttempt1 failed, try again here; Otherwise skip.
98+
if: ${{ steps.bundleAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
99+
run: bundle
100+
101+
- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
102+
id: bundleAppraisalAttempt1
103+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
92104
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
93105
# Continue to the next step on failure
94106
continue-on-error: true
95107

96108
# Effectively an automatic retry of the previous step.
97109
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
98-
# If bundleAttempt1 failed, try again here; Otherwise skip.
99-
if: ${{ steps.bundleAttempt1.outcome == 'failure' && !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
100-
id: bundleAttempt2
110+
id: bundleAppraisalAttempt2
111+
# If bundleAppraisalAttempt1 failed, try again here; Otherwise skip.
112+
if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
101113
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
102114

103-
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
104-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
115+
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
116+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
105117
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/heads.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ jobs:
6464

6565
steps:
6666
- name: Checkout
67-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
67+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
6868
uses: actions/checkout@v5
6969

7070
- name: Setup Ruby & RubyGems
71-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
71+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
7272
uses: ruby/setup-ruby@v1
7373
with:
7474
ruby-version: ${{ matrix.ruby }}
@@ -79,24 +79,38 @@ jobs:
7979
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
8080
# We need to do this first to get appraisal installed.
8181
# NOTE: This does not use the primary Gemfile at all.
82-
- name: "Install Root Appraisal"
83-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
82+
- name: Install Root Appraisal
83+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
8484
run: bundle
8585

86-
- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
87-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
86+
- name: "[Attempt 1] Install Root Appraisal"
8887
id: bundleAttempt1
88+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
89+
run: bundle
90+
# Continue to the next step on failure
91+
continue-on-error: true
92+
93+
# Effectively an automatic retry of the previous step.
94+
- name: "[Attempt 2] Install Root Appraisal"
95+
id: bundleAttempt2
96+
# If bundleAttempt1 failed, try again here; Otherwise skip.
97+
if: ${{ steps.bundleAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
98+
run: bundle
99+
100+
- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
101+
id: bundleAppraisalAttempt1
102+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
89103
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
90104
# Continue to the next step on failure
91105
continue-on-error: true
92106

93107
# Effectively an automatic retry of the previous step.
94108
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
95-
# If bundleAttempt1 failed, try again here; Otherwise skip.
96-
if: ${{ steps.bundleAttempt1.outcome == 'failure' && !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
97-
id: bundleAttempt2
109+
id: bundleAppraisalAttempt2
110+
# If bundleAppraisalAttempt1 failed, try again here; Otherwise skip.
111+
if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
98112
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
99113

100-
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
101-
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
114+
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
115+
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
102116
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/legacy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
appraisal: "ruby-3-1"
5151
exec_cmd: "rake test"
5252
gemfile: "Appraisal.root"
53-
rubygems: latest
54-
bundler: latest
53+
rubygems: '3.6.9'
54+
bundler: '2.6.9'
5555

5656
steps:
5757
- name: Checkout

.github/workflows/style.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ jobs:
6363
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
6464
- name: Run ${{ matrix.appraisal }} checks via ${{ matrix.exec_cmd }}
6565
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
66+
- name: Validate RBS Types
67+
run: bundle exec appraisal ${{ matrix.appraisal }} bin/rbs validate

0 commit comments

Comments
 (0)