Skip to content

Commit 35d43e3

Browse files
committed
✨ Utilize eval_gemfile with appraisals
- thoughtbot/appraisal#248
1 parent e51bb92 commit 35d43e3

26 files changed

+65
-172
lines changed

.rubocop_gradual.lock

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
"lib/turbo_tests/reporter.rb:1386902608": [
2626
[7, 5, 400, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 2092085575]
2727
],
28-
"lib/turbo_tests/runner.rb:3421474245": [
28+
"lib/turbo_tests/runner.rb:2492228125": [
2929
[13, 5, 271, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 21989008],
3030
[20, 5, 1311, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1925027850],
31-
[221, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
32-
[239, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
33-
[241, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
34-
[250, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
35-
[310, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
31+
[252, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
32+
[277, 47, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
33+
[278, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
34+
[280, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
35+
[296, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
36+
[356, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
3637
],
3738
"spec/cli_spec.rb:3990998076": [
3839
[1, 1, 30, "RSpec/SpecFilePathFormat: Spec path should end with `turbo_tests/cli*_spec.rb`.", 965721356],
@@ -61,8 +62,8 @@
6162
[10, 15, 7, "RSpec/MessageSpies: Prefer `have_received` for setting message expectations. Setup `ParallelTests::Tasks` as a spy using `allow` or `instance_spy`.", 1384559950],
6263
[20, 15, 7, "RSpec/MessageSpies: Prefer `have_received` for setting message expectations. Setup `ParallelTests::Tasks` as a spy using `allow` or `instance_spy`.", 1384559950]
6364
],
64-
"turbo_tests.gemspec:2105011563": [
65-
[30, 16, 36, "ThreadSafety/DirChdir: Avoid using `Dir.chdir` due to its process-wide effect.", 3576345059],
66-
[31, 5, 19, "Packaging/GemspecGit: Avoid using git to produce lists of files. Downstreams often need to build your package in an environment that does not have git (on purpose). Use some pure Ruby alternative, like `Dir` or `Dir.glob`.", 3879951891]
65+
"turbo_tests.gemspec:2921004918": [
66+
[29, 16, 36, "ThreadSafety/DirChdir: Avoid using `Dir.chdir` due to its process-wide effect.", 3576345059],
67+
[30, 5, 19, "Packaging/GemspecGit: Avoid using git to produce lists of files. Downstreams often need to build your package in an environment that does not have git (on purpose). Use some pure Ruby alternative, like `Dir` or `Dir.glob`.", 3879951891]
6768
]
6869
}

Appraisal.boot.gemfile

Lines changed: 0 additions & 8 deletions
This file was deleted.

Appraisal.root.gemfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
33
source "https://rubygems.org"
44

55
# Appraisal Root Gemfile is for running appraisal to generate the Appraisal Gemfiles
6-
# in gemfiles/*gemfile. It is not loaded on CI.
7-
# On CI we only run it for the Appraisal-based builds.
6+
# in gemfiles/*gemfile.
7+
# On CI, we use it for the Appraisal-based builds.
88
# We do not load the standard Gemfile, as it is tailored for local development.
99

1010
gemspec
1111

12-
# Allow usage of eval_gemfile inside our Appraisal definitions
13-
# Solution is based on this comment:
14-
# https://github.com/thoughtbot/appraisal/issues/154#issuecomment-493804217
15-
# (and fixed to work in 2025)
16-
eval_gemfile "appraisal-hack.gemfile"
12+
gem "appraisal", github: "pboling/appraisal", branch: "eval_gemfile"

Appraisals

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,77 @@
33
appraise "ruby-2-7" do
44
gem "mutex_m", "~> 0.2"
55
gem "stringio", "~> 3.0"
6+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
67
end
78

89
appraise "ruby-3-0" do
910
gem "mutex_m", "~> 0.2"
1011
gem "stringio", "~> 3.0"
12+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
1113
end
1214

1315
appraise "ruby-3-1" do
1416
gem "mutex_m", "~> 0.2"
1517
gem "stringio", "~> 3.0"
18+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
1619
end
1720

1821
appraise "ruby-3-2" do
1922
gem "mutex_m", "~> 0.2"
2023
gem "stringio", "~> 3.0"
24+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
2125
end
2226

2327
appraise "ruby-3-3" do
2428
gem "mutex_m", "~> 0.2"
2529
gem "stringio", "~> 3.0"
30+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
2631
end
2732

2833
appraise "ruby-3-4" do
2934
gem "mutex_m", "~> 0.2"
3035
gem "stringio", "~> 3.0"
36+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
3137
end
3238

3339
# Only run security audit on latest Ruby version
3440
appraise "audit" do
3541
gem "mutex_m", "~> 0.2"
3642
gem "stringio", "~> 3.0"
3743
eval_gemfile "modular/audit.gemfile"
44+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
3845
end
3946

4047
# Only run coverage on latest Ruby version
4148
appraise "coverage" do
4249
gem "mutex_m", "~> 0.2"
4350
gem "stringio", "~> 3.0"
4451
eval_gemfile "modular/coverage.gemfile"
52+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
4553
end
4654

4755
# Only run linter on latest Ruby version (but, in support of oldest supported Ruby version)
4856
appraise "style" do
4957
gem "mutex_m", "~> 0.2"
5058
gem "stringio", "~> 3.0"
5159
eval_gemfile "modular/style.gemfile"
60+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
5261
end
5362

5463
appraise "ruby-head" do
5564
gem "mutex_m", ">= 0.2"
5665
gem "stringio", ">= 3.0"
66+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
5767
end
5868

5969
appraise "truffleruby-head" do
6070
gem "mutex_m", ">= 0.2"
6171
gem "stringio", ">= 3.0"
72+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
6273
end
6374

6475
appraise "jruby-head" do
6576
gem "mutex_m", ">= 0.2"
6677
gem "stringio", ">= 3.0"
78+
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
6779
end

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ eval_gemfile "gemfiles/modular/coverage.gemfile"
2020

2121
# Linting
2222
eval_gemfile "gemfiles/modular/style.gemfile"
23+
24+
gem "appraisal", path: "/Users/pboling/src/forks/appraisal"

Gemfile.lock

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ PATH
55
parallel_tests (>= 3.3.0, < 5)
66
rspec (>= 3.10)
77

8-
GEM
9-
remote: https://rubygems.org/
8+
PATH
9+
remote: /Users/pboling/src/forks/appraisal
1010
specs:
11-
ansi (1.5.0)
12-
appraisal (2.5.0)
11+
appraisal (3.0.0.rc1)
1312
bundler
1413
rake
1514
thor (>= 0.14.0)
15+
16+
GEM
17+
remote: https://rubygems.org/
18+
specs:
19+
ansi (1.5.0)
1620
ast (2.4.2)
1721
benchmark (0.4.0)
1822
bundler-audit (0.9.2)
@@ -32,13 +36,13 @@ GEM
3236
simplecov-rcov (~> 0.3, >= 0.3.3)
3337
simplecov_json_formatter (~> 0.1, >= 0.1.4)
3438
version_gem (~> 1.1, >= 1.1.4)
35-
language_server-protocol (3.17.0.3)
39+
language_server-protocol (3.17.0.4)
3640
lint_roller (1.1.0)
3741
method_source (1.1.0)
3842
parallel (1.26.3)
3943
parallel_tests (4.9.0)
4044
parallel
41-
parser (3.3.6.0)
45+
parser (3.3.7.0)
4246
ast (~> 2.4.1)
4347
racc
4448
pry (0.15.2)
@@ -63,7 +67,7 @@ GEM
6367
diff-lcs (>= 1.2.0, < 2.0)
6468
rspec-support (~> 3.13.0)
6569
rspec-support (3.13.2)
66-
rubocop (1.69.2)
70+
rubocop (1.70.0)
6771
json (~> 2.3)
6872
language_server-protocol (>= 3.17.0)
6973
parallel (~> 1.10)
@@ -73,7 +77,7 @@ GEM
7377
rubocop-ast (>= 1.36.2, < 2.0)
7478
ruby-progressbar (~> 1.7)
7579
unicode-display_width (>= 2.4.0, < 4.0)
76-
rubocop-ast (1.37.0)
80+
rubocop-ast (1.38.0)
7781
parser (>= 3.3.1.0)
7882
rubocop-gradual (0.3.6)
7983
diff-lcs (>= 1.2.0, < 2.0)
@@ -94,7 +98,7 @@ GEM
9498
rubocop-ast (>= 1.31.1, < 2.0)
9599
rubocop-rake (0.6.0)
96100
rubocop (~> 1.0)
97-
rubocop-rspec (3.3.0)
101+
rubocop-rspec (3.4.0)
98102
rubocop (~> 1.61)
99103
rubocop-ruby2_7 (2.0.6)
100104
rubocop-gradual (~> 0.3, >= 0.3.1)
@@ -125,10 +129,10 @@ GEM
125129
simplecov-rcov (0.3.7)
126130
simplecov (>= 0.4.1)
127131
simplecov_json_formatter (0.1.4)
128-
standard (1.43.0)
132+
standard (1.44.0)
129133
language_server-protocol (~> 3.17.0.2)
130134
lint_roller (~> 1.0)
131-
rubocop (~> 1.69.1)
135+
rubocop (~> 1.70.0)
132136
standard-custom (~> 1.0.0)
133137
standard-performance (~> 1.6)
134138
standard-custom (1.0.2)
@@ -143,7 +147,8 @@ GEM
143147
standard-custom (>= 1.0.2, < 2)
144148
standard-performance (>= 1.3.1, < 2)
145149
version_gem (>= 1.1.4, < 3)
146-
terminal-table (1.6.0)
150+
terminal-table (4.0.0)
151+
unicode-display_width (>= 1.1.1, < 4)
147152
thor (1.3.2)
148153
unicode-display_width (3.1.4)
149154
unicode-emoji (~> 4.0, >= 4.0.4)
@@ -154,7 +159,7 @@ PLATFORMS
154159
ruby
155160

156161
DEPENDENCIES
157-
appraisal (~> 2.5)
162+
appraisal!
158163
benchmark (~> 0.4)
159164
bundler-audit (~> 0.9.2)
160165
kettle-soup-cover (~> 1.0, >= 1.0.4)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ From time to time the appraisal gemfiles in `gemfiles/` will need to be updated.
127127
They are created and updated with the command:
128128

129129
```shell
130-
BUNDLE_GEMFILE=Appraisal.root.gemfile appraisal update
130+
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle install
131+
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update
131132
```
132133

133134
## Contributing

appraisal-hack.gemfile

Lines changed: 0 additions & 40 deletions
This file was deleted.

gemfiles/appraisal-hack.gemfile

Lines changed: 0 additions & 40 deletions
This file was deleted.

gemfiles/audit.gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ gem "stringio", "~> 3.0"
77

88
gemspec path: "../"
99

10-
eval_gemfile("appraisal-hack.gemfile")
11-
1210
eval_gemfile("modular/audit.gemfile")

gemfiles/audit.gemfile.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ PATH
88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
appraisal (2.5.0)
12-
bundler
13-
rake
14-
thor (>= 0.14.0)
1511
bundler-audit (0.9.2)
1612
bundler (>= 1.2.0, < 3)
1713
thor (~> 1.0)
@@ -53,7 +49,6 @@ PLATFORMS
5349
x86_64-linux-musl
5450

5551
DEPENDENCIES
56-
appraisal (~> 2.5)
5752
bundler-audit (~> 0.9.2)
5853
mutex_m (~> 0.2)
5954
pry (~> 0.14)

gemfiles/coverage.gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ gem "stringio", "~> 3.0"
77

88
gemspec path: "../"
99

10-
eval_gemfile("appraisal-hack.gemfile")
11-
1210
eval_gemfile("modular/coverage.gemfile")

0 commit comments

Comments
 (0)