Skip to content

Commit

Permalink
✨ Utilize eval_gemfile with appraisals
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Feb 3, 2025
1 parent e51bb92 commit 35d43e3
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 172 deletions.
19 changes: 10 additions & 9 deletions .rubocop_gradual.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
"lib/turbo_tests/reporter.rb:1386902608": [
[7, 5, 400, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 2092085575]
],
"lib/turbo_tests/runner.rb:3421474245": [
"lib/turbo_tests/runner.rb:2492228125": [
[13, 5, 271, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 21989008],
[20, 5, 1311, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1925027850],
[221, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[239, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
[241, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[250, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[310, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
[252, 11, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[277, 47, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
[278, 47, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
[280, 21, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[296, 7, 10, "ThreadSafety/NewThread: Avoid starting new threads.", 3411682361],
[356, 9, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952]
],
"spec/cli_spec.rb:3990998076": [
[1, 1, 30, "RSpec/SpecFilePathFormat: Spec path should end with `turbo_tests/cli*_spec.rb`.", 965721356],
Expand Down Expand Up @@ -61,8 +62,8 @@
[10, 15, 7, "RSpec/MessageSpies: Prefer `have_received` for setting message expectations. Setup `ParallelTests::Tasks` as a spy using `allow` or `instance_spy`.", 1384559950],
[20, 15, 7, "RSpec/MessageSpies: Prefer `have_received` for setting message expectations. Setup `ParallelTests::Tasks` as a spy using `allow` or `instance_spy`.", 1384559950]
],
"turbo_tests.gemspec:2105011563": [
[30, 16, 36, "ThreadSafety/DirChdir: Avoid using `Dir.chdir` due to its process-wide effect.", 3576345059],
[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]
"turbo_tests.gemspec:2921004918": [
[29, 16, 36, "ThreadSafety/DirChdir: Avoid using `Dir.chdir` due to its process-wide effect.", 3576345059],
[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]
]
}
8 changes: 0 additions & 8 deletions Appraisal.boot.gemfile

This file was deleted.

10 changes: 3 additions & 7 deletions Appraisal.root.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
source "https://rubygems.org"

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

gemspec

# Allow usage of eval_gemfile inside our Appraisal definitions
# Solution is based on this comment:
# https://github.com/thoughtbot/appraisal/issues/154#issuecomment-493804217
# (and fixed to work in 2025)
eval_gemfile "appraisal-hack.gemfile"
gem "appraisal", github: "pboling/appraisal", branch: "eval_gemfile"
12 changes: 12 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,77 @@
appraise "ruby-2-7" do
gem "mutex_m", "~> 0.2"
gem "stringio", "~> 3.0"
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
end

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

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

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

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

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

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

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

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

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

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

appraise "jruby-head" do
gem "mutex_m", ">= 0.2"
gem "stringio", ">= 3.0"
remove_gem "appraisal" # only present because it must be in the gemfile because we target a git branch
end
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ eval_gemfile "gemfiles/modular/coverage.gemfile"

# Linting
eval_gemfile "gemfiles/modular/style.gemfile"

gem "appraisal", path: "/Users/pboling/src/forks/appraisal"
31 changes: 18 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ PATH
parallel_tests (>= 3.3.0, < 5)
rspec (>= 3.10)

GEM
remote: https://rubygems.org/
PATH
remote: /Users/pboling/src/forks/appraisal
specs:
ansi (1.5.0)
appraisal (2.5.0)
appraisal (3.0.0.rc1)
bundler
rake
thor (>= 0.14.0)

GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
ast (2.4.2)
benchmark (0.4.0)
bundler-audit (0.9.2)
Expand All @@ -32,13 +36,13 @@ GEM
simplecov-rcov (~> 0.3, >= 0.3.3)
simplecov_json_formatter (~> 0.1, >= 0.1.4)
version_gem (~> 1.1, >= 1.1.4)
language_server-protocol (3.17.0.3)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
method_source (1.1.0)
parallel (1.26.3)
parallel_tests (4.9.0)
parallel
parser (3.3.6.0)
parser (3.3.7.0)
ast (~> 2.4.1)
racc
pry (0.15.2)
Expand All @@ -63,7 +67,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rubocop (1.69.2)
rubocop (1.70.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -73,7 +77,7 @@ GEM
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-gradual (0.3.6)
diff-lcs (>= 1.2.0, < 2.0)
Expand All @@ -94,7 +98,7 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (3.3.0)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
rubocop-ruby2_7 (2.0.6)
rubocop-gradual (~> 0.3, >= 0.3.1)
Expand Down Expand Up @@ -125,10 +129,10 @@ GEM
simplecov-rcov (0.3.7)
simplecov (>= 0.4.1)
simplecov_json_formatter (0.1.4)
standard (1.43.0)
standard (1.44.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.69.1)
rubocop (~> 1.70.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.6)
standard-custom (1.0.2)
Expand All @@ -143,7 +147,8 @@ GEM
standard-custom (>= 1.0.2, < 2)
standard-performance (>= 1.3.1, < 2)
version_gem (>= 1.1.4, < 3)
terminal-table (1.6.0)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
thor (1.3.2)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
Expand All @@ -154,7 +159,7 @@ PLATFORMS
ruby

DEPENDENCIES
appraisal (~> 2.5)
appraisal!
benchmark (~> 0.4)
bundler-audit (~> 0.9.2)
kettle-soup-cover (~> 1.0, >= 1.0.4)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ From time to time the appraisal gemfiles in `gemfiles/` will need to be updated.
They are created and updated with the command:

```shell
BUNDLE_GEMFILE=Appraisal.root.gemfile appraisal update
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle install
BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update
```

## Contributing
Expand Down
40 changes: 0 additions & 40 deletions appraisal-hack.gemfile

This file was deleted.

40 changes: 0 additions & 40 deletions gemfiles/appraisal-hack.gemfile

This file was deleted.

2 changes: 0 additions & 2 deletions gemfiles/audit.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ gem "stringio", "~> 3.0"

gemspec path: "../"

eval_gemfile("appraisal-hack.gemfile")

eval_gemfile("modular/audit.gemfile")
5 changes: 0 additions & 5 deletions gemfiles/audit.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ PATH
GEM
remote: https://rubygems.org/
specs:
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
bundler-audit (0.9.2)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
Expand Down Expand Up @@ -53,7 +49,6 @@ PLATFORMS
x86_64-linux-musl

DEPENDENCIES
appraisal (~> 2.5)
bundler-audit (~> 0.9.2)
mutex_m (~> 0.2)
pry (~> 0.14)
Expand Down
2 changes: 0 additions & 2 deletions gemfiles/coverage.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ gem "stringio", "~> 3.0"

gemspec path: "../"

eval_gemfile("appraisal-hack.gemfile")

eval_gemfile("modular/coverage.gemfile")
Loading

0 comments on commit 35d43e3

Please sign in to comment.