Skip to content

Commit 5a0d41c

Browse files
authored
Merge pull request #1471 from MITLibraries/pw-173-rails72
Rails 7.2 and Ruby 3.4
2 parents 46ff7e0 + a41acc0 commit 5a0d41c

File tree

21 files changed

+291
-147
lines changed

21 files changed

+291
-147
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.9
1+
3.4.6

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:3.2.9@sha256:7cfeeb9cdc8826b394f76784c8e227f46e4374269830f7171998e0252b78230a
1+
FROM ruby:3.4.6@sha256:df2711f5259070c14de6c5433f4b357c20728b66135c9494c081c53a96160251
22
RUN mkdir /bento
33
WORKDIR /bento
44
COPY Gemfile /bento/Gemfile

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source 'https://rubygems.org'
2-
ruby '3.2.9'
2+
ruby '3.4.6'
33

44
gem 'actionpack-action_caching', github: 'rails/actionpack-action_caching', branch: 'master'
55
gem 'barnes'
@@ -18,7 +18,7 @@ gem 'net-smtp', require: false
1818
gem 'nokogiri'
1919
gem 'puma'
2020
gem 'rack-attack'
21-
gem 'rails', '~> 7.1.0'
21+
gem 'rails', '~> 7.2.0'
2222
gem 'sass-rails'
2323
gem 'sentry-rails'
2424
gem 'sentry-ruby'

Gemfile.lock

Lines changed: 68 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -18,83 +18,77 @@ GIT
1818
GEM
1919
remote: https://rubygems.org/
2020
specs:
21-
actioncable (7.1.5.2)
22-
actionpack (= 7.1.5.2)
23-
activesupport (= 7.1.5.2)
21+
actioncable (7.2.2.2)
22+
actionpack (= 7.2.2.2)
23+
activesupport (= 7.2.2.2)
2424
nio4r (~> 2.0)
2525
websocket-driver (>= 0.6.1)
2626
zeitwerk (~> 2.6)
27-
actionmailbox (7.1.5.2)
28-
actionpack (= 7.1.5.2)
29-
activejob (= 7.1.5.2)
30-
activerecord (= 7.1.5.2)
31-
activestorage (= 7.1.5.2)
32-
activesupport (= 7.1.5.2)
33-
mail (>= 2.7.1)
34-
net-imap
35-
net-pop
36-
net-smtp
37-
actionmailer (7.1.5.2)
38-
actionpack (= 7.1.5.2)
39-
actionview (= 7.1.5.2)
40-
activejob (= 7.1.5.2)
41-
activesupport (= 7.1.5.2)
42-
mail (~> 2.5, >= 2.5.4)
43-
net-imap
44-
net-pop
45-
net-smtp
27+
actionmailbox (7.2.2.2)
28+
actionpack (= 7.2.2.2)
29+
activejob (= 7.2.2.2)
30+
activerecord (= 7.2.2.2)
31+
activestorage (= 7.2.2.2)
32+
activesupport (= 7.2.2.2)
33+
mail (>= 2.8.0)
34+
actionmailer (7.2.2.2)
35+
actionpack (= 7.2.2.2)
36+
actionview (= 7.2.2.2)
37+
activejob (= 7.2.2.2)
38+
activesupport (= 7.2.2.2)
39+
mail (>= 2.8.0)
4640
rails-dom-testing (~> 2.2)
47-
actionpack (7.1.5.2)
48-
actionview (= 7.1.5.2)
49-
activesupport (= 7.1.5.2)
41+
actionpack (7.2.2.2)
42+
actionview (= 7.2.2.2)
43+
activesupport (= 7.2.2.2)
5044
nokogiri (>= 1.8.5)
5145
racc
52-
rack (>= 2.2.4)
46+
rack (>= 2.2.4, < 3.2)
5347
rack-session (>= 1.0.1)
5448
rack-test (>= 0.6.3)
5549
rails-dom-testing (~> 2.2)
5650
rails-html-sanitizer (~> 1.6)
57-
actiontext (7.1.5.2)
58-
actionpack (= 7.1.5.2)
59-
activerecord (= 7.1.5.2)
60-
activestorage (= 7.1.5.2)
61-
activesupport (= 7.1.5.2)
51+
useragent (~> 0.16)
52+
actiontext (7.2.2.2)
53+
actionpack (= 7.2.2.2)
54+
activerecord (= 7.2.2.2)
55+
activestorage (= 7.2.2.2)
56+
activesupport (= 7.2.2.2)
6257
globalid (>= 0.6.0)
6358
nokogiri (>= 1.8.5)
64-
actionview (7.1.5.2)
65-
activesupport (= 7.1.5.2)
59+
actionview (7.2.2.2)
60+
activesupport (= 7.2.2.2)
6661
builder (~> 3.1)
6762
erubi (~> 1.11)
6863
rails-dom-testing (~> 2.2)
6964
rails-html-sanitizer (~> 1.6)
70-
activejob (7.1.5.2)
71-
activesupport (= 7.1.5.2)
65+
activejob (7.2.2.2)
66+
activesupport (= 7.2.2.2)
7267
globalid (>= 0.3.6)
73-
activemodel (7.1.5.2)
74-
activesupport (= 7.1.5.2)
75-
activerecord (7.1.5.2)
76-
activemodel (= 7.1.5.2)
77-
activesupport (= 7.1.5.2)
68+
activemodel (7.2.2.2)
69+
activesupport (= 7.2.2.2)
70+
activerecord (7.2.2.2)
71+
activemodel (= 7.2.2.2)
72+
activesupport (= 7.2.2.2)
7873
timeout (>= 0.4.0)
79-
activestorage (7.1.5.2)
80-
actionpack (= 7.1.5.2)
81-
activejob (= 7.1.5.2)
82-
activerecord (= 7.1.5.2)
83-
activesupport (= 7.1.5.2)
74+
activestorage (7.2.2.2)
75+
actionpack (= 7.2.2.2)
76+
activejob (= 7.2.2.2)
77+
activerecord (= 7.2.2.2)
78+
activesupport (= 7.2.2.2)
8479
marcel (~> 1.0)
85-
activesupport (7.1.5.2)
80+
activesupport (7.2.2.2)
8681
base64
8782
benchmark (>= 0.3)
8883
bigdecimal
89-
concurrent-ruby (~> 1.0, >= 1.0.2)
84+
concurrent-ruby (~> 1.0, >= 1.3.1)
9085
connection_pool (>= 2.2.5)
9186
drb
9287
i18n (>= 1.6, < 2)
9388
logger (>= 1.4.2)
9489
minitest (>= 5.1)
95-
mutex_m
9690
securerandom (>= 0.3)
97-
tzinfo (~> 2.0)
91+
tzinfo (~> 2.0, >= 2.0.5)
9892
addressable (2.8.7)
9993
public_suffix (>= 2.0.2, < 7.0)
10094
annotate (3.2.0)
@@ -117,7 +111,6 @@ GEM
117111
bootsnap (1.18.6)
118112
msgpack (~> 1.2)
119113
builder (3.3.0)
120-
cgi (0.5.0)
121114
climate_control (1.2.0)
122115
concurrent-ruby (1.3.5)
123116
connection_pool (2.5.4)
@@ -139,8 +132,7 @@ GEM
139132
dotenv (= 3.1.8)
140133
railties (>= 6.1)
141134
drb (2.2.3)
142-
erb (2.2.3)
143-
cgi
135+
erb (5.0.2)
144136
erubi (1.13.1)
145137
execjs (2.10.0)
146138
faraday (2.12.2)
@@ -154,7 +146,7 @@ GEM
154146
ffi (>= 1.15.5)
155147
rake
156148
gems (1.3.0)
157-
globalid (1.2.1)
149+
globalid (1.3.0)
158150
activesupport (>= 6.1)
159151
google-api-client (0.53.0)
160152
google-apis-core (~> 0.1)
@@ -236,7 +228,7 @@ GEM
236228
net-imap
237229
net-pop
238230
net-smtp
239-
marcel (1.0.4)
231+
marcel (1.1.0)
240232
mini_mime (1.1.5)
241233
mini_portile2 (2.8.9)
242234
minitest (5.25.5)
@@ -280,7 +272,7 @@ GEM
280272
puma (7.0.4)
281273
nio4r (~> 2.0)
282274
racc (1.8.1)
283-
rack (3.2.1)
275+
rack (3.1.16)
284276
rack-attack (6.7.0)
285277
rack (>= 1.0, < 4)
286278
rack-session (2.1.1)
@@ -290,31 +282,31 @@ GEM
290282
rack (>= 1.3)
291283
rackup (2.2.1)
292284
rack (>= 3)
293-
rails (7.1.5.2)
294-
actioncable (= 7.1.5.2)
295-
actionmailbox (= 7.1.5.2)
296-
actionmailer (= 7.1.5.2)
297-
actionpack (= 7.1.5.2)
298-
actiontext (= 7.1.5.2)
299-
actionview (= 7.1.5.2)
300-
activejob (= 7.1.5.2)
301-
activemodel (= 7.1.5.2)
302-
activerecord (= 7.1.5.2)
303-
activestorage (= 7.1.5.2)
304-
activesupport (= 7.1.5.2)
285+
rails (7.2.2.2)
286+
actioncable (= 7.2.2.2)
287+
actionmailbox (= 7.2.2.2)
288+
actionmailer (= 7.2.2.2)
289+
actionpack (= 7.2.2.2)
290+
actiontext (= 7.2.2.2)
291+
actionview (= 7.2.2.2)
292+
activejob (= 7.2.2.2)
293+
activemodel (= 7.2.2.2)
294+
activerecord (= 7.2.2.2)
295+
activestorage (= 7.2.2.2)
296+
activesupport (= 7.2.2.2)
305297
bundler (>= 1.15.0)
306-
railties (= 7.1.5.2)
298+
railties (= 7.2.2.2)
307299
rails-dom-testing (2.3.0)
308300
activesupport (>= 5.0.0)
309301
minitest
310302
nokogiri (>= 1.6)
311303
rails-html-sanitizer (1.6.2)
312304
loofah (~> 2.21)
313305
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)
314-
railties (7.1.5.2)
315-
actionpack (= 7.1.5.2)
316-
activesupport (= 7.1.5.2)
317-
irb
306+
railties (7.2.2.2)
307+
actionpack (= 7.2.2.2)
308+
activesupport (= 7.2.2.2)
309+
irb (~> 1.13)
318310
rackup (>= 1.0.0)
319311
rake (>= 12.2)
320312
thor (~> 1.0, >= 1.2.2)
@@ -417,6 +409,7 @@ GEM
417409
unicode-emoji (~> 4.1)
418410
unicode-emoji (4.1.0)
419411
uri (1.0.3)
412+
useragent (0.16.11)
420413
vcr (6.3.1)
421414
base64
422415
web-console (4.2.1)
@@ -428,7 +421,7 @@ GEM
428421
addressable (>= 2.8.0)
429422
crack (>= 0.3.2)
430423
hashdiff (>= 0.4.0, < 2.0.0)
431-
websocket-driver (0.7.7)
424+
websocket-driver (0.8.0)
432425
base64
433426
websocket-extensions (>= 0.1.0)
434427
websocket-extensions (0.1.5)
@@ -466,7 +459,7 @@ DEPENDENCIES
466459
pg
467460
puma
468461
rack-attack
469-
rails (~> 7.1.0)
462+
rails (~> 7.2.0)
470463
rubocop
471464
rubocop-rails
472465
sass-rails
@@ -483,7 +476,7 @@ DEPENDENCIES
483476
webmock
484477

485478
RUBY VERSION
486-
ruby 3.2.9p265
479+
ruby 3.4.6p54
487480

488481
BUNDLED WITH
489482
2.4.19

app/models/normalize_timdex.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def extract_collection_id(identifiers)
6868

6969
def extract_list(contributors)
7070
contributors&.map do |creator|
71-
[creator['value'], '&field[]=creators_text&q[]=' << URI.encode_www_form_component(creator['value'])]
71+
[creator['value'], "&field[]=creators_text&q[]=#{URI.encode_www_form_component(creator['value'])}"]
7272
end
7373
end
7474

bin/rubocop

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env ruby
2+
require "rubygems"
3+
require "bundler/setup"
4+
5+
# explicit rubocop config increases performance slightly while avoiding config confusion.
6+
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7+
8+
load Gem.bin_path("rubocop", "rubocop")

bin/setup

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env ruby
22
require "fileutils"
33

4-
# path to your application root.
54
APP_ROOT = File.expand_path("..", __dir__)
5+
APP_NAME = "mit-bento"
66

77
def system!(*args)
88
system(*args, exception: true)
@@ -30,4 +30,8 @@ FileUtils.chdir APP_ROOT do
3030

3131
puts "\n== Restarting application server =="
3232
system! "bin/rails restart"
33+
34+
# puts "\n== Configuring puma-dev =="
35+
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
36+
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
3337
end

config/application.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
module MitBento
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
12-
config.load_defaults 7.1
12+
config.load_defaults 7.2
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.
1616
# Common ones are `templates`, `generators`, or `middleware`, for example.
17-
config.autoload_lib(ignore: %w(assets tasks))
17+
config.autoload_lib(ignore: %w[assets tasks])
1818

1919
# Configuration for the application, engines, and railties goes here.
2020
#

config/environments/development.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Show full error reports.
1515
config.consider_all_requests_local = true
1616

17-
# Enable server timing
17+
# Enable server timing.
1818
config.server_timing = true
1919

2020
# Enable/disable caching. By default caching is disabled.
@@ -24,9 +24,7 @@
2424
config.action_controller.enable_fragment_cache_logging = true
2525

2626
config.cache_store = :memory_store
27-
config.public_file_server.headers = {
28-
"Cache-Control" => "public, max-age=#{2.days.to_i}"
29-
}
27+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
3028
else
3129
config.action_controller.perform_caching = false
3230

@@ -39,9 +37,13 @@
3937
# Don't care if the mailer can't send.
4038
config.action_mailer.raise_delivery_errors = false
4139

40+
# Disable caching for Action Mailer templates even if Action Controller
41+
# caching is enabled.
42+
#
4243
config.action_mailer.perform_caching = false
4344

4445
config.action_mailer.delivery_method = :file
46+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
4547

4648
# Print deprecation notices to the Rails logger.
4749
config.active_support.deprecation = :log
@@ -93,6 +95,9 @@
9395
# Uncomment if you wish to allow Action Cable access from any origin.
9496
# config.action_cable.disable_request_forgery_protection = true
9597

96-
# Raise error when a before_action's only/except options reference missing actions
98+
# Raise error when a before_action's only/except options reference missing actions.
9799
config.action_controller.raise_on_missing_callback_actions = true
100+
101+
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
102+
# config.generators.apply_rubocop_autocorrect_after_generate!
98103
end

0 commit comments

Comments
 (0)