Skip to content

Commit b776eff

Browse files
authored
Merge pull request #50 from amatsuda/rails72
Rails 7.2
2 parents 59a9e16 + a7023b7 commit b776eff

19 files changed

+267
-114
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source "https://rubygems.org"
33
ruby file: '.ruby-version'
44

55
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6-
gem "rails", "~> 7.1.3", ">= 7.1.3.4"
6+
gem "rails", "~> 7.2.0"
77

88
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
99
gem "sprockets-rails"

Gemfile.lock

Lines changed: 63 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,77 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.1.5.2)
5-
actionpack (= 7.1.5.2)
6-
activesupport (= 7.1.5.2)
4+
actioncable (7.2.2.2)
5+
actionpack (= 7.2.2.2)
6+
activesupport (= 7.2.2.2)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.1.5.2)
11-
actionpack (= 7.1.5.2)
12-
activejob (= 7.1.5.2)
13-
activerecord (= 7.1.5.2)
14-
activestorage (= 7.1.5.2)
15-
activesupport (= 7.1.5.2)
16-
mail (>= 2.7.1)
17-
net-imap
18-
net-pop
19-
net-smtp
20-
actionmailer (7.1.5.2)
21-
actionpack (= 7.1.5.2)
22-
actionview (= 7.1.5.2)
23-
activejob (= 7.1.5.2)
24-
activesupport (= 7.1.5.2)
25-
mail (~> 2.5, >= 2.5.4)
26-
net-imap
27-
net-pop
28-
net-smtp
10+
actionmailbox (7.2.2.2)
11+
actionpack (= 7.2.2.2)
12+
activejob (= 7.2.2.2)
13+
activerecord (= 7.2.2.2)
14+
activestorage (= 7.2.2.2)
15+
activesupport (= 7.2.2.2)
16+
mail (>= 2.8.0)
17+
actionmailer (7.2.2.2)
18+
actionpack (= 7.2.2.2)
19+
actionview (= 7.2.2.2)
20+
activejob (= 7.2.2.2)
21+
activesupport (= 7.2.2.2)
22+
mail (>= 2.8.0)
2923
rails-dom-testing (~> 2.2)
30-
actionpack (7.1.5.2)
31-
actionview (= 7.1.5.2)
32-
activesupport (= 7.1.5.2)
24+
actionpack (7.2.2.2)
25+
actionview (= 7.2.2.2)
26+
activesupport (= 7.2.2.2)
3327
nokogiri (>= 1.8.5)
3428
racc
35-
rack (>= 2.2.4)
29+
rack (>= 2.2.4, < 3.2)
3630
rack-session (>= 1.0.1)
3731
rack-test (>= 0.6.3)
3832
rails-dom-testing (~> 2.2)
3933
rails-html-sanitizer (~> 1.6)
40-
actiontext (7.1.5.2)
41-
actionpack (= 7.1.5.2)
42-
activerecord (= 7.1.5.2)
43-
activestorage (= 7.1.5.2)
44-
activesupport (= 7.1.5.2)
34+
useragent (~> 0.16)
35+
actiontext (7.2.2.2)
36+
actionpack (= 7.2.2.2)
37+
activerecord (= 7.2.2.2)
38+
activestorage (= 7.2.2.2)
39+
activesupport (= 7.2.2.2)
4540
globalid (>= 0.6.0)
4641
nokogiri (>= 1.8.5)
47-
actionview (7.1.5.2)
48-
activesupport (= 7.1.5.2)
42+
actionview (7.2.2.2)
43+
activesupport (= 7.2.2.2)
4944
builder (~> 3.1)
5045
erubi (~> 1.11)
5146
rails-dom-testing (~> 2.2)
5247
rails-html-sanitizer (~> 1.6)
53-
activejob (7.1.5.2)
54-
activesupport (= 7.1.5.2)
48+
activejob (7.2.2.2)
49+
activesupport (= 7.2.2.2)
5550
globalid (>= 0.3.6)
56-
activemodel (7.1.5.2)
57-
activesupport (= 7.1.5.2)
58-
activerecord (7.1.5.2)
59-
activemodel (= 7.1.5.2)
60-
activesupport (= 7.1.5.2)
51+
activemodel (7.2.2.2)
52+
activesupport (= 7.2.2.2)
53+
activerecord (7.2.2.2)
54+
activemodel (= 7.2.2.2)
55+
activesupport (= 7.2.2.2)
6156
timeout (>= 0.4.0)
62-
activestorage (7.1.5.2)
63-
actionpack (= 7.1.5.2)
64-
activejob (= 7.1.5.2)
65-
activerecord (= 7.1.5.2)
66-
activesupport (= 7.1.5.2)
57+
activestorage (7.2.2.2)
58+
actionpack (= 7.2.2.2)
59+
activejob (= 7.2.2.2)
60+
activerecord (= 7.2.2.2)
61+
activesupport (= 7.2.2.2)
6762
marcel (~> 1.0)
68-
activesupport (7.1.5.2)
63+
activesupport (7.2.2.2)
6964
base64
7065
benchmark (>= 0.3)
7166
bigdecimal
72-
concurrent-ruby (~> 1.0, >= 1.0.2)
67+
concurrent-ruby (~> 1.0, >= 1.3.1)
7368
connection_pool (>= 2.2.5)
7469
drb
7570
i18n (>= 1.6, < 2)
7671
logger (>= 1.4.2)
7772
minitest (>= 5.1)
78-
mutex_m
7973
securerandom (>= 0.3)
80-
tzinfo (~> 2.0)
74+
tzinfo (~> 2.0, >= 2.0.5)
8175
addressable (2.8.7)
8276
public_suffix (>= 2.0.2, < 7.0)
8377
ast (2.4.3)
@@ -163,7 +157,6 @@ GEM
163157
mini_mime (1.1.5)
164158
minitest (5.26.0)
165159
msgpack (1.8.0)
166-
mutex_m (0.3.0)
167160
net-imap (0.5.12)
168161
date
169162
net-protocol
@@ -212,39 +205,39 @@ GEM
212205
puma (7.0.4)
213206
nio4r (~> 2.0)
214207
racc (1.8.1)
215-
rack (3.2.3)
208+
rack (3.1.18)
216209
rack-session (2.1.1)
217210
base64 (>= 0.1.0)
218211
rack (>= 3.0.0)
219212
rack-test (2.2.0)
220213
rack (>= 1.3)
221214
rackup (2.2.1)
222215
rack (>= 3)
223-
rails (7.1.5.2)
224-
actioncable (= 7.1.5.2)
225-
actionmailbox (= 7.1.5.2)
226-
actionmailer (= 7.1.5.2)
227-
actionpack (= 7.1.5.2)
228-
actiontext (= 7.1.5.2)
229-
actionview (= 7.1.5.2)
230-
activejob (= 7.1.5.2)
231-
activemodel (= 7.1.5.2)
232-
activerecord (= 7.1.5.2)
233-
activestorage (= 7.1.5.2)
234-
activesupport (= 7.1.5.2)
216+
rails (7.2.2.2)
217+
actioncable (= 7.2.2.2)
218+
actionmailbox (= 7.2.2.2)
219+
actionmailer (= 7.2.2.2)
220+
actionpack (= 7.2.2.2)
221+
actiontext (= 7.2.2.2)
222+
actionview (= 7.2.2.2)
223+
activejob (= 7.2.2.2)
224+
activemodel (= 7.2.2.2)
225+
activerecord (= 7.2.2.2)
226+
activestorage (= 7.2.2.2)
227+
activesupport (= 7.2.2.2)
235228
bundler (>= 1.15.0)
236-
railties (= 7.1.5.2)
229+
railties (= 7.2.2.2)
237230
rails-dom-testing (2.3.0)
238231
activesupport (>= 5.0.0)
239232
minitest
240233
nokogiri (>= 1.6)
241234
rails-html-sanitizer (1.6.2)
242235
loofah (~> 2.21)
243236
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)
244-
railties (7.1.5.2)
245-
actionpack (= 7.1.5.2)
246-
activesupport (= 7.1.5.2)
247-
irb
237+
railties (7.2.2.2)
238+
actionpack (= 7.2.2.2)
239+
activesupport (= 7.2.2.2)
240+
irb (~> 1.13)
248241
rackup (>= 1.0.0)
249242
rake (>= 12.2)
250243
thor (~> 1.0, >= 1.2.2)
@@ -312,6 +305,7 @@ GEM
312305
unicode-display_width (3.2.0)
313306
unicode-emoji (~> 4.1)
314307
unicode-emoji (4.1.0)
308+
useragent (0.16.11)
315309
web-console (4.2.1)
316310
actionview (>= 6.0.0)
317311
activemodel (>= 6.0.0)
@@ -349,7 +343,7 @@ DEPENDENCIES
349343
importmap-rails
350344
pg
351345
puma (>= 5.0)
352-
rails (~> 7.1.3, >= 7.1.3.4)
346+
rails (~> 7.2.0)
353347
rubocop
354348
selenium-webdriver
355349
simplecov

bin/brakeman

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
require "rubygems"
3+
require "bundler/setup"
4+
5+
ARGV.unshift("--ensure-latest")
6+
7+
load Gem.bin_path("brakeman", "brakeman")

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 = "blade-ruby-lang-org"
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 BladeRubyLangOrg
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: 11 additions & 6 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,8 +37,12 @@
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.
4242
config.action_mailer.perform_caching = false
4343

44+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
45+
4446
# Print deprecation notices to the Rails logger.
4547
config.active_support.deprecation = :log
4648

@@ -66,11 +68,14 @@
6668
# config.i18n.raise_on_missing_translations = true
6769

6870
# Annotate rendered view with file names.
69-
# config.action_view.annotate_rendered_view_with_filenames = true
71+
config.action_view.annotate_rendered_view_with_filenames = true
7072

7173
# Uncomment if you wish to allow Action Cable access from any origin.
7274
# config.action_cable.disable_request_forgery_protection = true
7375

74-
# Raise error when a before_action's only/except options reference missing actions
76+
# Raise error when a before_action's only/except options reference missing actions.
7577
config.action_controller.raise_on_missing_callback_actions = true
78+
79+
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
80+
# config.generators.apply_rubocop_autocorrect_after_generate!
7681
end

config/environments/production.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
5252
config.force_ssl = true
5353

54+
# Skip http-to-https redirect for the default health check endpoint.
55+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
56+
5457
# Log to STDOUT by default
5558
config.logger = ActiveSupport::Logger.new(STDOUT)
5659
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
@@ -71,6 +74,8 @@
7174
# config.active_job.queue_adapter = :resque
7275
# config.active_job.queue_name_prefix = "blade_ruby_lang_org_production"
7376

77+
# Disable caching for Action Mailer templates even if Action Controller
78+
# caching is enabled.
7479
config.action_mailer.perform_caching = false
7580

7681
# Ignore bad email addresses and do not raise email delivery errors.
@@ -87,6 +92,9 @@
8792
# Do not dump schema after migrations.
8893
config.active_record.dump_schema_after_migration = false
8994

95+
# Only use :id for inspections in production.
96+
config.active_record.attributes_for_inspect = [ :id ]
97+
9098
# Enable DNS rebinding protection and other `Host` header attacks.
9199
# config.hosts = [
92100
# "example.com", # Allow requests from example.com

config/environments/test.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
config.eager_load = ENV["CI"].present?
1919

2020
# Configure public file server for tests with Cache-Control for performance.
21-
config.public_file_server.enabled = true
22-
config.public_file_server.headers = {
23-
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
24-
}
21+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
2522

2623
# Show full error reports and disable caching.
2724
config.consider_all_requests_local = true
@@ -37,13 +34,19 @@
3734
# Store uploaded files on the local file system in a temporary directory.
3835
config.active_storage.service = :test
3936

37+
# Disable caching for Action Mailer templates even if Action Controller
38+
# caching is enabled.
4039
config.action_mailer.perform_caching = false
4140

4241
# Tell Action Mailer not to deliver emails to the real world.
4342
# The :test delivery method accumulates sent emails in the
4443
# ActionMailer::Base.deliveries array.
4544
config.action_mailer.delivery_method = :test
4645

46+
# Unlike controllers, the mailer instance doesn't have any context about the
47+
# incoming request so you'll need to provide the :host parameter yourself.
48+
config.action_mailer.default_url_options = { host: "www.example.com" }
49+
4750
# Print deprecation notices to the stderr.
4851
config.active_support.deprecation = :stderr
4952

@@ -59,6 +62,6 @@
5962
# Annotate rendered view with file names.
6063
# config.action_view.annotate_rendered_view_with_filenames = true
6164

62-
# Raise error when a before_action's only/except options reference missing actions
65+
# Raise error when a before_action's only/except options reference missing actions.
6366
config.action_controller.raise_on_missing_callback_actions = true
6467
end

config/initializers/assets.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# Precompile additional assets.
1010
# application.js, application.css, and all non-JS/CSS in the app/assets
1111
# folder are already added.
12-
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
12+
# Rails.application.config.assets.precompile += %w[ admin.js admin.css ]

0 commit comments

Comments
 (0)