Skip to content

Commit 628796a

Browse files
authored
Update dev Ruby; drop old Rubies and Rails (#187)
1 parent 2dc72eb commit 628796a

20 files changed

+69
-277
lines changed

.github/workflows/super_diff.yml

Lines changed: 28 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ concurrency:
1212
group: build-${{ github.event.pull_request.number || github.ref }}
1313
cancel-in-progress: true
1414
jobs:
15+
all:
16+
runs-on: ubuntu-latest
17+
needs:
18+
- lint
19+
- audit
20+
- test
21+
outputs:
22+
PASSED: ${{ steps.set-output.outputs.PASSED }}
23+
steps:
24+
- name: Set PASSED output
25+
id: set-output
26+
run: echo "PASSED=true" >> "$GITHUB_OUTPUT"
1527
lint:
1628
runs-on: ubuntu-latest
1729
steps:
@@ -25,71 +37,48 @@ jobs:
2537
with:
2638
node-version-file: ".nvmrc"
2739
cache: "yarn"
28-
- name: Install Ruby dependencies
29-
run: bin/ci/install
3040
- name: Install Yarn dependencies
3141
run: yarn --immutable
3242
- name: Lint
3343
run: yarn lint
3444
audit:
3545
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@v3
38-
- name: Set up Ruby
39-
uses: ruby/setup-ruby@v1
40-
with:
41-
bundler-cache: true
42-
- name: Use Node.js
43-
uses: actions/setup-node@v3
44-
with:
45-
node-version-file: ".nvmrc"
46-
cache: "yarn"
47-
- name: Install Ruby dependencies
48-
run: bin/ci/install
49-
- name: Install Yarn dependencies
50-
run: yarn --immutable
51-
- name: Audit
52-
run: yarn audit
53-
test:
54-
needs:
55-
- lint
56-
runs-on: ubuntu-20.04
5746
strategy:
5847
fail-fast: false
5948
matrix:
6049
ruby:
61-
- 2.5
62-
- 2.6
63-
- 2.7
50+
- "3.0"
51+
- "3.1"
52+
- "3.2"
6453
rails_appraisal:
65-
- rails_5_0
66-
- rails_5_1
67-
- rails_5_2
68-
- rails_6_0
6954
- rails_6_1
55+
- rails_7_0
7056
- no_rails
7157
rspec_appraisal:
7258
- rspec_lt_3_10
7359
- rspec_gte_3_10
74-
exclude:
75-
- rails_appraisal: rails_6_1
76-
rspec_appraisal: rspec_lt_3_10
77-
7860
env:
7961
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
80-
JAVA_OPTS: "--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.io=org.jruby.dist"
8162
steps:
8263
- uses: actions/checkout@v3
8364
- name: Set up Ruby
8465
uses: ruby/setup-ruby@v1
8566
with:
8667
ruby-version: ${{ matrix.ruby }}
8768
bundler-cache: true
88-
- name: Run tests
89-
run: bin/ci/run-tests
90-
test_ruby_3:
69+
- name: Use Node.js
70+
uses: actions/setup-node@v3
71+
with:
72+
node-version-file: ".nvmrc"
73+
cache: "yarn"
74+
- name: Install Yarn dependencies
75+
run: yarn --immutable
76+
- name: Audit
77+
run: yarn audit
78+
test:
9179
needs:
9280
- lint
81+
- audit
9382
runs-on: ubuntu-20.04
9483
strategy:
9584
fail-fast: false
@@ -99,26 +88,14 @@ jobs:
9988
- "3.1"
10089
- "3.2"
10190
rails_appraisal:
102-
- rails_6_0
10391
- rails_6_1
10492
- rails_7_0
10593
- no_rails
10694
rspec_appraisal:
10795
- rspec_lt_3_10
10896
- rspec_gte_3_10
109-
exclude:
110-
- ruby: 3.2
111-
rails_appraisal: rails_6_0
112-
- ruby: 3.2
113-
rails_appraisal: rails_6_1
114-
- rails_appraisal: rails_6_1
115-
rspec_appraisal: rspec_lt_3_10
116-
- rails_appraisal: rails_7_0
117-
rspec_appraisal: rspec_lt_3_10
118-
11997
env:
12098
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
121-
JAVA_OPTS: "--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=java.base/java.io=org.jruby.dist"
12299
steps:
123100
- uses: actions/checkout@v3
124101
- name: Set up Ruby
@@ -127,4 +104,4 @@ jobs:
127104
ruby-version: ${{ matrix.ruby }}
128105
bundler-cache: true
129106
- name: Run tests
130-
run: bin/ci/run-tests
107+
run: bundle exec rake --trace

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.0
1+
3.2.1

Appraisals

Lines changed: 8 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,10 @@ rails_dependencies =
22
proc do
33
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
44
gem "jdbc-sqlite3", platform: :jruby
5-
install_if '-> { Gem::Requirement.new(">= 2.6.0").satisfied_by?(Gem::Version.new(RUBY_VERSION)) }' do
6-
gem "net-ftp"
7-
end
5+
gem "net-ftp"
86
end
97

108
appraisals = {
11-
rails_5_0:
12-
proc do
13-
instance_eval(&rails_dependencies)
14-
15-
gem "activerecord", "~> 5.0.0"
16-
gem "railties", "~> 5.0.0"
17-
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
18-
end,
19-
rails_5_1:
20-
proc do
21-
instance_eval(&rails_dependencies)
22-
23-
gem "activerecord", "~> 5.1.0"
24-
gem "railties", "~> 5.1.0"
25-
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
26-
end,
27-
rails_5_2:
28-
proc do
29-
instance_eval(&rails_dependencies)
30-
31-
gem "activerecord", "~> 5.2.0"
32-
gem "railties", "~> 5.2.0"
33-
gem "sqlite3", "~> 1.3.6", platform: %i[ruby mswin mingw]
34-
end,
359
rails_6_0:
3610
proc do
3711
instance_eval(&rails_dependencies)
@@ -75,44 +49,17 @@ appraisals = {
7549
end
7650
}
7751

78-
rails_appraisals = [:no_rails]
79-
80-
if Gem::Requirement.new("< 3").satisfied_by?(Gem::Version.new(RUBY_VERSION))
81-
rails_appraisals << :rails_5_0
82-
rails_appraisals << :rails_5_1
83-
rails_appraisals << :rails_5_2
84-
end
85-
86-
if Gem::Requirement.new(">= 2.5.0").satisfied_by?(
87-
Gem::Version.new(RUBY_VERSION)
88-
)
89-
rails_appraisals << :rails_6_0
90-
rails_appraisals << :rails_6_1
91-
end
92-
93-
if Gem::Requirement.new(">= 2.7.0").satisfied_by?(
94-
Gem::Version.new(RUBY_VERSION)
95-
)
96-
rails_appraisals << :rails_7_0
97-
end
98-
52+
rails_appraisals = %i[no_rails rails_6_0 rails_6_1 rails_7_0]
9953
rspec_appraisals = %i[rspec_lt_3_10 rspec_gte_3_10]
10054

10155
rails_appraisals.each do |rails_appraisal|
10256
rspec_appraisals.each do |rspec_appraisal|
103-
if rails_appraisal == :no_rails
104-
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
105-
instance_eval(&appraisals.fetch(rails_appraisal))
106-
instance_exec(false, &appraisals.fetch(rspec_appraisal))
107-
end
108-
elsif %i[rails_6_1 rails_7_0].include?(rails_appraisal) &&
109-
rspec_appraisal == :rspec_lt_3_10
110-
next
111-
else
112-
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
113-
instance_eval(&appraisals.fetch(rails_appraisal))
114-
instance_exec(true, &appraisals.fetch(rspec_appraisal))
115-
end
57+
appraise "#{rails_appraisal}_#{rspec_appraisal}" do
58+
instance_eval(&appraisals.fetch(rails_appraisal))
59+
instance_exec(
60+
rails_appraisal != :no_rails,
61+
&appraisals.fetch(rspec_appraisal)
62+
)
11663
end
11764
end
11865
end

Gemfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ source "https://rubygems.org"
44

55
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
66

7-
gem "appraisal",
8-
github: "thoughtbot/appraisal",
9-
ref: "2f5be65b8e127bd602fd149f395f2f8fa50616a8"
7+
gem "appraisal", github: "thoughtbot/appraisal"
108
gem "bundler-audit"
119
gem "childprocess"
1210
gem "climate_control"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ I'll get notified right away!
270270
## Compatibility
271271

272272
`super_diff` is [tested][gh-actions] to work with
273-
Ruby >= 2.5.x,
273+
Ruby >= 3.x,
274274
RSpec 3.x,
275-
and Rails >= 5.x.
275+
and Rails >= 6.x.
276276

277277
[gh-actions]: https://github.com/mcmire/super_diff/actions?query=workflow%3ASuperDiff
278278

bin/ci/install

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

bin/ci/run-tests

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

gemfiles/no_rails_rspec_gte_3_10.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
source "https://rubygems.org"
44

5-
gem "appraisal", ref: "2f5be65b8e127bd602fd149f395f2f8fa50616a8", git: "https://github.com/thoughtbot/appraisal"
5+
gem "appraisal", git: "https://github.com/thoughtbot/appraisal"
6+
gem "bundler-audit"
67
gem "childprocess"
78
gem "climate_control"
89
gem "pry-byebug", platform: :mri

gemfiles/no_rails_rspec_lt_3_10.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
source "https://rubygems.org"
44

5-
gem "appraisal", ref: "2f5be65b8e127bd602fd149f395f2f8fa50616a8", git: "https://github.com/thoughtbot/appraisal"
5+
gem "appraisal", git: "https://github.com/thoughtbot/appraisal"
6+
gem "bundler-audit"
67
gem "childprocess"
78
gem "climate_control"
89
gem "pry-byebug", platform: :mri

gemfiles/rails_5_0_rspec_gte_3_10.gemfile

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

0 commit comments

Comments
 (0)