Skip to content

Commit 99f220d

Browse files
committed
Update to Rails 8.1 and Ruby 3.4
* Use ruby:3.4-slim image in Docker. * Adapt configuration to Rails 8.1. * Add required Active Storage migrations. * `rails app:update` automatically added dark mode support to public/*. Closes: AP-759
1 parent 39eda3d commit 99f220d

24 files changed

Lines changed: 434 additions & 217 deletions

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# The base stage scaffolds elements which are common to building and running
55
# the application, such as installing ca-certificates, creating the app user,
66
# and installing runtime system dependencies.
7-
FROM ruby:3.3-slim AS base
7+
FROM ruby:3.4-slim AS base
88

99
# ------------------------------------------------------------
1010
# Declarative metadata

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby '~> 3.0'
4+
ruby '~> 3.4'
55

66
gem 'amazing_print', '~> 1.1'
77
gem 'berkeley_library-docker'
@@ -19,7 +19,7 @@ gem 'okcomputer', '~> 1.19'
1919
gem 'ougai', '~> 1.8'
2020
gem 'puma', '~> 7.2.1'
2121
gem 'puma-plugin-delayed_stop', '~> 0.1.2'
22-
gem 'rails', '~> 8.0.0'
22+
gem 'rails', '~> 8.1.3'
2323
gem 'rake'
2424
gem 'sass-rails', '>= 6'
2525
gem 'turbolinks'
@@ -28,7 +28,7 @@ gem 'will_paginate'
2828

2929
group :development, :test do
3030
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
31-
gem 'byebug', platforms: %i[mri mingw x64_mingw]
31+
gem 'byebug', platforms: %i[mri windows]
3232
gem 'rspec-rails', '~> 8.0'
3333
gem 'simplecov', require: false
3434
gem 'simplecov-rcov', require: false

Gemfile.lock

Lines changed: 81 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,75 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (8.0.5)
5-
actionpack (= 8.0.5)
6-
activesupport (= 8.0.5)
4+
action_text-trix (2.1.19)
5+
railties
6+
actioncable (8.1.3)
7+
actionpack (= 8.1.3)
8+
activesupport (= 8.1.3)
79
nio4r (~> 2.0)
810
websocket-driver (>= 0.6.1)
911
zeitwerk (~> 2.6)
10-
actionmailbox (8.0.5)
11-
actionpack (= 8.0.5)
12-
activejob (= 8.0.5)
13-
activerecord (= 8.0.5)
14-
activestorage (= 8.0.5)
15-
activesupport (= 8.0.5)
12+
actionmailbox (8.1.3)
13+
actionpack (= 8.1.3)
14+
activejob (= 8.1.3)
15+
activerecord (= 8.1.3)
16+
activestorage (= 8.1.3)
17+
activesupport (= 8.1.3)
1618
mail (>= 2.8.0)
17-
actionmailer (8.0.5)
18-
actionpack (= 8.0.5)
19-
actionview (= 8.0.5)
20-
activejob (= 8.0.5)
21-
activesupport (= 8.0.5)
19+
actionmailer (8.1.3)
20+
actionpack (= 8.1.3)
21+
actionview (= 8.1.3)
22+
activejob (= 8.1.3)
23+
activesupport (= 8.1.3)
2224
mail (>= 2.8.0)
2325
rails-dom-testing (~> 2.2)
24-
actionpack (8.0.5)
25-
actionview (= 8.0.5)
26-
activesupport (= 8.0.5)
26+
actionpack (8.1.3)
27+
actionview (= 8.1.3)
28+
activesupport (= 8.1.3)
2729
nokogiri (>= 1.8.5)
2830
rack (>= 2.2.4)
2931
rack-session (>= 1.0.1)
3032
rack-test (>= 0.6.3)
3133
rails-dom-testing (~> 2.2)
3234
rails-html-sanitizer (~> 1.6)
3335
useragent (~> 0.16)
34-
actiontext (8.0.5)
35-
actionpack (= 8.0.5)
36-
activerecord (= 8.0.5)
37-
activestorage (= 8.0.5)
38-
activesupport (= 8.0.5)
36+
actiontext (8.1.3)
37+
action_text-trix (~> 2.1.15)
38+
actionpack (= 8.1.3)
39+
activerecord (= 8.1.3)
40+
activestorage (= 8.1.3)
41+
activesupport (= 8.1.3)
3942
globalid (>= 0.6.0)
4043
nokogiri (>= 1.8.5)
41-
actionview (8.0.5)
42-
activesupport (= 8.0.5)
44+
actionview (8.1.3)
45+
activesupport (= 8.1.3)
4346
builder (~> 3.1)
4447
erubi (~> 1.11)
4548
rails-dom-testing (~> 2.2)
4649
rails-html-sanitizer (~> 1.6)
47-
activejob (8.0.5)
48-
activesupport (= 8.0.5)
50+
activejob (8.1.3)
51+
activesupport (= 8.1.3)
4952
globalid (>= 0.3.6)
50-
activemodel (8.0.5)
51-
activesupport (= 8.0.5)
52-
activerecord (8.0.5)
53-
activemodel (= 8.0.5)
54-
activesupport (= 8.0.5)
53+
activemodel (8.1.3)
54+
activesupport (= 8.1.3)
55+
activerecord (8.1.3)
56+
activemodel (= 8.1.3)
57+
activesupport (= 8.1.3)
5558
timeout (>= 0.4.0)
56-
activestorage (8.0.5)
57-
actionpack (= 8.0.5)
58-
activejob (= 8.0.5)
59-
activerecord (= 8.0.5)
60-
activesupport (= 8.0.5)
59+
activestorage (8.1.3)
60+
actionpack (= 8.1.3)
61+
activejob (= 8.1.3)
62+
activerecord (= 8.1.3)
63+
activesupport (= 8.1.3)
6164
marcel (~> 1.0)
62-
activesupport (8.0.5)
65+
activesupport (8.1.3)
6366
base64
64-
benchmark (>= 0.3)
6567
bigdecimal
6668
concurrent-ruby (~> 1.0, >= 1.3.1)
6769
connection_pool (>= 2.2.5)
6870
drb
6971
i18n (>= 1.6, < 2)
72+
json
7073
logger (>= 1.4.2)
7174
minitest (>= 5.1)
7275
securerandom (>= 0.3)
@@ -95,8 +98,8 @@ GEM
9598
brakeman (8.0.5)
9699
racc
97100
builder (3.3.0)
98-
bundler-audit (0.9.2)
99-
bundler (>= 1.2.0, < 3)
101+
bundler-audit (0.9.3)
102+
bundler (>= 1.2.0)
100103
thor (~> 1.0)
101104
byebug (12.0.0)
102105
capybara (3.40.0)
@@ -118,7 +121,7 @@ GEM
118121
colorize (0.8.1)
119122
concurrent-ruby (1.3.7)
120123
connection_pool (3.0.2)
121-
crass (1.0.6)
124+
crass (1.0.7)
122125
date (3.5.1)
123126
diff-lcs (1.6.2)
124127
docile (1.4.1)
@@ -131,12 +134,12 @@ GEM
131134
ffi (1.17.2-x86_64-linux-gnu)
132135
font-awesome-rails (4.7.0.9)
133136
railties (>= 3.2, < 9.0)
134-
globalid (1.3.0)
137+
globalid (1.4.0)
135138
activesupport (>= 6.1)
136-
i18n (1.14.8)
139+
i18n (1.15.2)
137140
concurrent-ruby (~> 1.0)
138141
io-console (0.8.2)
139-
irb (1.17.0)
142+
irb (1.18.0)
140143
pp (>= 0.6.0)
141144
prism (>= 1.3.0)
142145
rdoc (>= 4.0.0)
@@ -148,7 +151,7 @@ GEM
148151
rails-dom-testing (>= 1, < 3)
149152
railties (>= 4.2.0)
150153
thor (>= 0.14, < 2.0)
151-
json (2.19.3)
154+
json (2.20.0)
152155
language_server-protocol (3.17.0.5)
153156
lint_roller (1.1.0)
154157
listen (3.9.0)
@@ -169,10 +172,10 @@ GEM
169172
net-imap
170173
net-pop
171174
net-smtp
172-
marcel (1.1.0)
175+
marcel (1.2.1)
173176
matrix (0.4.3)
174177
mini_mime (1.1.5)
175-
minitest (6.0.2)
178+
minitest (6.0.6)
176179
drb (~> 2.0)
177180
prism (~> 1.5)
178181
mysql2 (0.5.7)
@@ -205,13 +208,10 @@ GEM
205208
parser (3.3.10.0)
206209
ast (~> 2.4.1)
207210
racc
208-
pp (0.6.3)
211+
pp (0.6.4)
209212
prettyprint
210213
prettyprint (0.2.0)
211-
prism (1.6.0)
212-
psych (5.3.1)
213-
date
214-
stringio
214+
prism (1.9.0)
215215
public_suffix (7.0.5)
216216
puma (7.2.1)
217217
nio4r (~> 2.0)
@@ -228,44 +228,49 @@ GEM
228228
rack (>= 1.3)
229229
rackup (2.3.1)
230230
rack (>= 3)
231-
rails (8.0.5)
232-
actioncable (= 8.0.5)
233-
actionmailbox (= 8.0.5)
234-
actionmailer (= 8.0.5)
235-
actionpack (= 8.0.5)
236-
actiontext (= 8.0.5)
237-
actionview (= 8.0.5)
238-
activejob (= 8.0.5)
239-
activemodel (= 8.0.5)
240-
activerecord (= 8.0.5)
241-
activestorage (= 8.0.5)
242-
activesupport (= 8.0.5)
231+
rails (8.1.3)
232+
actioncable (= 8.1.3)
233+
actionmailbox (= 8.1.3)
234+
actionmailer (= 8.1.3)
235+
actionpack (= 8.1.3)
236+
actiontext (= 8.1.3)
237+
actionview (= 8.1.3)
238+
activejob (= 8.1.3)
239+
activemodel (= 8.1.3)
240+
activerecord (= 8.1.3)
241+
activestorage (= 8.1.3)
242+
activesupport (= 8.1.3)
243243
bundler (>= 1.15.0)
244-
railties (= 8.0.5)
244+
railties (= 8.1.3)
245245
rails-dom-testing (2.3.0)
246246
activesupport (>= 5.0.0)
247247
minitest
248248
nokogiri (>= 1.6)
249249
rails-html-sanitizer (1.7.0)
250250
loofah (~> 2.25)
251251
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
252-
railties (8.0.5)
253-
actionpack (= 8.0.5)
254-
activesupport (= 8.0.5)
252+
railties (8.1.3)
253+
actionpack (= 8.1.3)
254+
activesupport (= 8.1.3)
255255
irb (~> 1.13)
256256
rackup (>= 1.0.0)
257257
rake (>= 12.2)
258258
thor (~> 1.0, >= 1.2.2)
259259
tsort (>= 0.2)
260260
zeitwerk (~> 2.6)
261261
rainbow (3.1.1)
262-
rake (13.3.1)
262+
rake (13.4.2)
263263
rb-fsevent (0.11.2)
264264
rb-inotify (0.11.1)
265265
ffi (~> 1.0)
266-
rdoc (7.2.0)
266+
rbs (4.0.3)
267+
logger
268+
prism (>= 1.6.0)
269+
tsort
270+
rdoc (8.0.0)
267271
erb
268-
psych (>= 4.0.0)
272+
prism (>= 1.6.0)
273+
rbs (>= 4.0.0)
269274
tsort
270275
regexp_parser (2.11.3)
271276
reline (0.6.3)
@@ -358,7 +363,6 @@ GEM
358363
actionpack (>= 6.1)
359364
activesupport (>= 6.1)
360365
sprockets (>= 3.0.0)
361-
stringio (3.2.0)
362366
thor (1.5.0)
363367
tilt (2.6.1)
364368
timeout (0.6.1)
@@ -384,14 +388,14 @@ GEM
384388
railties (>= 5.2)
385389
semantic_range (>= 2.3.0)
386390
websocket (1.2.11)
387-
websocket-driver (0.8.0)
391+
websocket-driver (0.8.2)
388392
base64
389393
websocket-extensions (>= 0.1.0)
390394
websocket-extensions (0.1.5)
391395
will_paginate (4.0.1)
392396
xpath (3.2.0)
393397
nokogiri (~> 1.8)
394-
zeitwerk (2.7.5)
398+
zeitwerk (2.8.2)
395399

396400
PLATFORMS
397401
aarch64-linux-gnu
@@ -420,7 +424,7 @@ DEPENDENCIES
420424
ougai (~> 1.8)
421425
puma (~> 7.2.1)
422426
puma-plugin-delayed_stop (~> 0.1.2)
423-
rails (~> 8.0.0)
427+
rails (~> 8.1.3)
424428
rake
425429
rspec-rails (~> 8.0)
426430
rspec_junit_formatter (~> 0.4.1)
@@ -439,7 +443,7 @@ DEPENDENCIES
439443
will_paginate
440444

441445
RUBY VERSION
442-
ruby 3.3.10p183
446+
ruby 3.4.9
443447

444448
BUNDLED WITH
445-
2.5.22
449+
4.0.8

bin/bundler-audit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
require_relative "../config/boot"
3+
require "bundler/audit/cli"
4+
5+
ARGV.concat %w[ --config config/bundler-audit.yml ] if ARGV.empty? || ARGV.include?("check")
6+
Bundler::Audit::CLI.start

bin/ci

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
require_relative "../config/boot"
3+
require "active_support/continuous_integration"
4+
5+
CI = ActiveSupport::ContinuousIntegration
6+
require_relative "../config/ci.rb"

bin/rubocop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require "rubygems"
33
require "bundler/setup"
44

5-
# explicit rubocop config increases performance slightly while avoiding config confusion.
5+
# Explicit RuboCop config increases performance slightly while avoiding config confusion.
66
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
77

88
load Gem.bin_path("rubocop", "rubocop")

bin/setup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ FileUtils.chdir APP_ROOT do
2222

2323
puts "\n== Preparing database =="
2424
system! "bin/rails db:prepare"
25+
system! "bin/rails db:reset" if ARGV.include?("--reset")
2526

2627
puts "\n== Removing old logs and tempfiles =="
2728
system! "bin/rails log:clear tmp:clear"

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
module NewNara
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
12-
config.load_defaults 8.0
12+
config.load_defaults 8.1
1313

1414
# Please, add to the `ignore` list any other `lib` subdirectories that do
1515
# not contain `.rb` files, or that should not be reloaded or eager loaded.

config/bundler-audit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Audit all gems listed in the Gemfile for known security problems by running bin/bundler-audit.
2+
# CVEs that are not relevant to the application can be enumerated on the ignore list below.
3+
4+
ignore:
5+
- CVE-THAT-DOES-NOT-APPLY

0 commit comments

Comments
 (0)