Skip to content

Commit 7fe4130

Browse files
authored
Merge pull request #86 from amatsuda/rails81
Rails 8..1
2 parents d0ff284 + ad13136 commit 7fe4130

File tree

20 files changed

+249
-107
lines changed

20 files changed

+249
-107
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ruby file: '.ruby-version'
55
gem 'nkf'
66

77
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
8-
gem "rails", "~> 8.0.0"
8+
gem "rails", "~> 8.1.0"
99

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

Gemfile.lock

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,74 +2,77 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
action_args (2.7.3)
5-
actioncable (8.0.3)
6-
actionpack (= 8.0.3)
7-
activesupport (= 8.0.3)
5+
action_text-trix (2.1.15)
6+
railties
7+
actioncable (8.1.1)
8+
actionpack (= 8.1.1)
9+
activesupport (= 8.1.1)
810
nio4r (~> 2.0)
911
websocket-driver (>= 0.6.1)
1012
zeitwerk (~> 2.6)
11-
actionmailbox (8.0.3)
12-
actionpack (= 8.0.3)
13-
activejob (= 8.0.3)
14-
activerecord (= 8.0.3)
15-
activestorage (= 8.0.3)
16-
activesupport (= 8.0.3)
13+
actionmailbox (8.1.1)
14+
actionpack (= 8.1.1)
15+
activejob (= 8.1.1)
16+
activerecord (= 8.1.1)
17+
activestorage (= 8.1.1)
18+
activesupport (= 8.1.1)
1719
mail (>= 2.8.0)
18-
actionmailer (8.0.3)
19-
actionpack (= 8.0.3)
20-
actionview (= 8.0.3)
21-
activejob (= 8.0.3)
22-
activesupport (= 8.0.3)
20+
actionmailer (8.1.1)
21+
actionpack (= 8.1.1)
22+
actionview (= 8.1.1)
23+
activejob (= 8.1.1)
24+
activesupport (= 8.1.1)
2325
mail (>= 2.8.0)
2426
rails-dom-testing (~> 2.2)
25-
actionpack (8.0.3)
26-
actionview (= 8.0.3)
27-
activesupport (= 8.0.3)
27+
actionpack (8.1.1)
28+
actionview (= 8.1.1)
29+
activesupport (= 8.1.1)
2830
nokogiri (>= 1.8.5)
2931
rack (>= 2.2.4)
3032
rack-session (>= 1.0.1)
3133
rack-test (>= 0.6.3)
3234
rails-dom-testing (~> 2.2)
3335
rails-html-sanitizer (~> 1.6)
3436
useragent (~> 0.16)
35-
actiontext (8.0.3)
36-
actionpack (= 8.0.3)
37-
activerecord (= 8.0.3)
38-
activestorage (= 8.0.3)
39-
activesupport (= 8.0.3)
37+
actiontext (8.1.1)
38+
action_text-trix (~> 2.1.15)
39+
actionpack (= 8.1.1)
40+
activerecord (= 8.1.1)
41+
activestorage (= 8.1.1)
42+
activesupport (= 8.1.1)
4043
globalid (>= 0.6.0)
4144
nokogiri (>= 1.8.5)
42-
actionview (8.0.3)
43-
activesupport (= 8.0.3)
45+
actionview (8.1.1)
46+
activesupport (= 8.1.1)
4447
builder (~> 3.1)
4548
erubi (~> 1.11)
4649
rails-dom-testing (~> 2.2)
4750
rails-html-sanitizer (~> 1.6)
4851
active_decorator (1.5.1)
4952
activesupport
50-
activejob (8.0.3)
51-
activesupport (= 8.0.3)
53+
activejob (8.1.1)
54+
activesupport (= 8.1.1)
5255
globalid (>= 0.3.6)
53-
activemodel (8.0.3)
54-
activesupport (= 8.0.3)
55-
activerecord (8.0.3)
56-
activemodel (= 8.0.3)
57-
activesupport (= 8.0.3)
56+
activemodel (8.1.1)
57+
activesupport (= 8.1.1)
58+
activerecord (8.1.1)
59+
activemodel (= 8.1.1)
60+
activesupport (= 8.1.1)
5861
timeout (>= 0.4.0)
59-
activestorage (8.0.3)
60-
actionpack (= 8.0.3)
61-
activejob (= 8.0.3)
62-
activerecord (= 8.0.3)
63-
activesupport (= 8.0.3)
62+
activestorage (8.1.1)
63+
actionpack (= 8.1.1)
64+
activejob (= 8.1.1)
65+
activerecord (= 8.1.1)
66+
activesupport (= 8.1.1)
6467
marcel (~> 1.0)
65-
activesupport (8.0.3)
68+
activesupport (8.1.1)
6669
base64
67-
benchmark (>= 0.3)
6870
bigdecimal
6971
concurrent-ruby (~> 1.0, >= 1.3.1)
7072
connection_pool (>= 2.2.5)
7173
drb
7274
i18n (>= 1.6, < 2)
75+
json
7376
logger (>= 1.4.2)
7477
minitest (>= 5.1)
7578
securerandom (>= 0.3)
@@ -98,7 +101,6 @@ GEM
98101
aws-sigv4 (1.12.1)
99102
aws-eventstream (~> 1, >= 1.0.2)
100103
base64 (0.3.0)
101-
benchmark (0.4.1)
102104
bigdecimal (3.3.1)
103105
bindex (0.8.1)
104106
bootsnap (1.18.6)
@@ -217,30 +219,30 @@ GEM
217219
rack (>= 1.3)
218220
rackup (2.2.1)
219221
rack (>= 3)
220-
rails (8.0.3)
221-
actioncable (= 8.0.3)
222-
actionmailbox (= 8.0.3)
223-
actionmailer (= 8.0.3)
224-
actionpack (= 8.0.3)
225-
actiontext (= 8.0.3)
226-
actionview (= 8.0.3)
227-
activejob (= 8.0.3)
228-
activemodel (= 8.0.3)
229-
activerecord (= 8.0.3)
230-
activestorage (= 8.0.3)
231-
activesupport (= 8.0.3)
222+
rails (8.1.1)
223+
actioncable (= 8.1.1)
224+
actionmailbox (= 8.1.1)
225+
actionmailer (= 8.1.1)
226+
actionpack (= 8.1.1)
227+
actiontext (= 8.1.1)
228+
actionview (= 8.1.1)
229+
activejob (= 8.1.1)
230+
activemodel (= 8.1.1)
231+
activerecord (= 8.1.1)
232+
activestorage (= 8.1.1)
233+
activesupport (= 8.1.1)
232234
bundler (>= 1.15.0)
233-
railties (= 8.0.3)
235+
railties (= 8.1.1)
234236
rails-dom-testing (2.3.0)
235237
activesupport (>= 5.0.0)
236238
minitest
237239
nokogiri (>= 1.6)
238240
rails-html-sanitizer (1.6.2)
239241
loofah (~> 2.21)
240242
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)
241-
railties (8.0.3)
242-
actionpack (= 8.0.3)
243-
activesupport (= 8.0.3)
243+
railties (8.1.1)
244+
actionpack (= 8.1.1)
245+
activesupport (= 8.1.1)
244246
irb (~> 1.13)
245247
rackup (>= 1.0.0)
246248
rake (>= 12.2)
@@ -362,7 +364,7 @@ DEPENDENCIES
362364
nkf
363365
pg
364366
puma (>= 5.0)
365-
rails (~> 8.0.0)
367+
rails (~> 8.1.0)
366368
rubocop
367369
selenium-webdriver
368370
simplecov

app/models/message.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def from_mail(mail, list, list_seq)
7777
file = StringIO.new(part.decoded)
7878
attachments.attach(io: file, filename: part.filename || 'noname', content_type: part.content_type)
7979
when /^text\/plain/, /text\/enriched;/, 'message/rfc822', nil
80-
(self.body ||= '') << Kconv.toutf8(part.body.raw_source)
80+
(self.body ||= ''.dup) << Kconv.toutf8(part.body.raw_source)
8181
when /^text\/html/
82-
(self.html_body ||= '') << Kconv.toutf8(part.body.raw_source)
82+
(self.html_body ||= ''.dup) << Kconv.toutf8(part.body.raw_source)
8383
else
8484
puts "Unknown content_type: #{part.content_type}"
8585
end

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/dev

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,2 @@
1-
#!/usr/bin/env sh
2-
3-
if ! gem list foreman -i --silent; then
4-
echo "Installing foreman..."
5-
gem install foreman
6-
fi
7-
8-
# Default to port 3000 if not specified
9-
export PORT="${PORT:-3000}"
10-
11-
# Let the debug gem allow remote connections,
12-
# but avoid loading until `debugger` is called
13-
export RUBY_DEBUG_OPEN="true"
14-
export RUBY_DEBUG_LAZY="true"
15-
16-
exec foreman start -f Procfile.dev "$@"
1+
#!/usr/bin/env ruby
2+
exec "./bin/rails", "server", *ARGV

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 BladeRubyLangOrg
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)