Skip to content

Commit 3efb6df

Browse files
authored
Merge pull request #704 from coderdojo-japan/Upgrade_to_rails5.2
Upgrade to rails5.2
2 parents ee9c3ac + 90c9946 commit 3efb6df

15 files changed

+203
-79
lines changed

Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
source 'https://rubygems.org'
22
ruby '2.6.5'
33

4-
gem 'rails', '~> 5.1.7'
4+
gem 'rails', '~> 5.2.0'
55
gem 'puma'
66
gem "puma_worker_killer"
77
gem 'pg'
88
gem 'dumper'
9+
gem 'bootsnap'
910

10-
gem 'scrivito', '~> 1.15.0'
11+
gem 'scrivito', '~> 1.16.0'
1112
gem 'scrivito_section_widgets'
1213
gem 'scrivito_teaser_widget'
1314

Gemfile.lock

Lines changed: 70 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (5.1.7)
5-
actionpack (= 5.1.7)
4+
actioncable (5.2.4.1)
5+
actionpack (= 5.2.4.1)
66
nio4r (~> 2.0)
7-
websocket-driver (~> 0.6.1)
8-
actionmailer (5.1.7)
9-
actionpack (= 5.1.7)
10-
actionview (= 5.1.7)
11-
activejob (= 5.1.7)
7+
websocket-driver (>= 0.6.1)
8+
actionmailer (5.2.4.1)
9+
actionpack (= 5.2.4.1)
10+
actionview (= 5.2.4.1)
11+
activejob (= 5.2.4.1)
1212
mail (~> 2.5, >= 2.5.4)
1313
rails-dom-testing (~> 2.0)
14-
actionpack (5.1.7)
15-
actionview (= 5.1.7)
16-
activesupport (= 5.1.7)
17-
rack (~> 2.0)
14+
actionpack (5.2.4.1)
15+
actionview (= 5.2.4.1)
16+
activesupport (= 5.2.4.1)
17+
rack (~> 2.0, >= 2.0.8)
1818
rack-test (>= 0.6.3)
1919
rails-dom-testing (~> 2.0)
2020
rails-html-sanitizer (~> 1.0, >= 1.0.2)
21-
actionview (5.1.7)
22-
activesupport (= 5.1.7)
21+
actionview (5.2.4.1)
22+
activesupport (= 5.2.4.1)
2323
builder (~> 3.1)
2424
erubi (~> 1.4)
2525
rails-dom-testing (~> 2.0)
2626
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27-
activejob (5.1.7)
28-
activesupport (= 5.1.7)
27+
activejob (5.2.4.1)
28+
activesupport (= 5.2.4.1)
2929
globalid (>= 0.3.6)
30-
activemodel (5.1.7)
31-
activesupport (= 5.1.7)
32-
activerecord (5.1.7)
33-
activemodel (= 5.1.7)
34-
activesupport (= 5.1.7)
35-
arel (~> 8.0)
36-
activesupport (5.1.7)
30+
activemodel (5.2.4.1)
31+
activesupport (= 5.2.4.1)
32+
activerecord (5.2.4.1)
33+
activemodel (= 5.2.4.1)
34+
activesupport (= 5.2.4.1)
35+
arel (>= 9.0)
36+
activestorage (5.2.4.1)
37+
actionpack (= 5.2.4.1)
38+
activerecord (= 5.2.4.1)
39+
marcel (~> 0.3.1)
40+
activesupport (5.2.4.1)
3741
concurrent-ruby (~> 1.0, >= 1.0.2)
3842
i18n (>= 0.7, < 2)
3943
minitest (~> 5.1)
4044
tzinfo (~> 1.1)
4145
addressable (2.7.0)
4246
public_suffix (>= 2.0.2, < 5.0)
43-
arel (8.0.0)
47+
arel (9.0.0)
4448
autoprefixer-rails (9.7.4)
4549
execjs
4650
backports (3.16.0)
4751
bindex (0.8.1)
4852
binding_of_caller (0.8.0)
4953
debug_inspector (>= 0.0.1)
54+
bootsnap (1.4.5)
55+
msgpack (~> 1.0)
5056
bootstrap-sass (3.4.1)
5157
autoprefixer-rails (>= 5.2.1)
5258
sassc (>= 2.0.0)
@@ -191,6 +197,8 @@ GEM
191197
nokogiri (>= 1.5.9)
192198
mail (2.7.1)
193199
mini_mime (>= 0.1.1)
200+
marcel (0.3.3)
201+
mimemagic (~> 0.3.2)
194202
memoist (0.16.2)
195203
memory_profiler (0.9.14)
196204
method_source (0.9.2)
@@ -203,6 +211,7 @@ GEM
203211
minitest (5.14.0)
204212
minitest-retry (0.2.0)
205213
minitest (>= 5.0)
214+
msgpack (1.3.1)
206215
multi_json (1.14.1)
207216
multi_xml (0.6.0)
208217
multipart-post (2.1.1)
@@ -250,17 +259,18 @@ GEM
250259
rack-user_agent (0.5.2)
251260
rack (>= 1.5)
252261
woothee (>= 1.0.0)
253-
rails (5.1.7)
254-
actioncable (= 5.1.7)
255-
actionmailer (= 5.1.7)
256-
actionpack (= 5.1.7)
257-
actionview (= 5.1.7)
258-
activejob (= 5.1.7)
259-
activemodel (= 5.1.7)
260-
activerecord (= 5.1.7)
261-
activesupport (= 5.1.7)
262+
rails (5.2.4.1)
263+
actioncable (= 5.2.4.1)
264+
actionmailer (= 5.2.4.1)
265+
actionpack (= 5.2.4.1)
266+
actionview (= 5.2.4.1)
267+
activejob (= 5.2.4.1)
268+
activemodel (= 5.2.4.1)
269+
activerecord (= 5.2.4.1)
270+
activestorage (= 5.2.4.1)
271+
activesupport (= 5.2.4.1)
262272
bundler (>= 1.3.0)
263-
railties (= 5.1.7)
273+
railties (= 5.2.4.1)
264274
sprockets-rails (>= 2.0.0)
265275
rails-controller-testing (1.0.4)
266276
actionpack (>= 5.0.1.x)
@@ -271,12 +281,12 @@ GEM
271281
nokogiri (>= 1.6)
272282
rails-html-sanitizer (1.2.0)
273283
loofah (~> 2.2, >= 2.2.2)
274-
railties (5.1.7)
275-
actionpack (= 5.1.7)
276-
activesupport (= 5.1.7)
284+
railties (5.2.4.1)
285+
actionpack (= 5.2.4.1)
286+
activesupport (= 5.2.4.1)
277287
method_source
278288
rake (>= 0.8.7)
279-
thor (>= 0.18.1, < 2.0)
289+
thor (>= 0.19.0, < 2.0)
280290
rake (13.0.1)
281291
rb-fsevent (0.10.3)
282292
rb-inotify (0.10.1)
@@ -323,38 +333,38 @@ GEM
323333
tilt (>= 1.1, < 3)
324334
sassc (2.2.1)
325335
ffi (~> 1.9)
326-
scrivito (1.15.0)
327-
scrivito_content_browser (= 1.15.0)
328-
scrivito_editors (= 1.15.0)
329-
scrivito_sdk (= 1.15.0)
330-
scrivito_ui (= 1.15.0)
331-
scrivito_content_browser (1.15.0)
336+
scrivito (1.16.0)
337+
scrivito_content_browser (= 1.16.0)
338+
scrivito_editors (= 1.16.0)
339+
scrivito_sdk (= 1.16.0)
340+
scrivito_ui (= 1.16.0)
341+
scrivito_content_browser (1.16.0)
332342
railties
333-
scrivito_sdk (= 1.15.0)
334-
scrivito_editors (1.15.0)
343+
scrivito_sdk (= 1.16.0)
344+
scrivito_editors (1.16.0)
335345
jquery-ui-rails (>= 5.0.0, < 7.0.0)
336346
railties
337-
scrivito_content_browser (= 1.15.0)
338-
scrivito_sdk (= 1.15.0)
339-
scrivito_sdk (1.15.0)
347+
scrivito_content_browser (= 1.16.0)
348+
scrivito_sdk (= 1.16.0)
349+
scrivito_sdk (1.16.0)
340350
addressable (~> 2.3)
341351
connection_pool (~> 2.2)
342-
diff-lcs (~> 1.2)
352+
diff-lcs (~> 1.3)
343353
hyp_diff (~> 0.0.4)
344-
jbuilder (~> 2.0)
345-
jquery-rails (~> 4.0)
346-
json (>= 1.8.3)
354+
jbuilder (~> 2.6)
355+
jquery-rails (~> 4.1)
356+
json (>= 1.8.6)
347357
memoist (>= 0.12.0)
348358
multi_json (~> 1.9)
349359
multipart-post (~> 2.0)
350-
nokogiri (~> 1.6)
351-
rails (>= 4.2, < 5.2)
360+
nokogiri (~> 1.7)
361+
rails (~> 5.2.0)
352362
rake (>= 0.9.2.2)
353363
scrivito_section_widgets (1.1.2)
354364
scrivito
355365
scrivito_teaser_widget (0.1.2)
356366
scrivito
357-
scrivito_ui (1.15.0)
367+
scrivito_ui (1.16.0)
358368
railties
359369
secure_headers (6.3.0)
360370
selenium-webdriver (3.142.7)
@@ -405,7 +415,7 @@ GEM
405415
bindex (>= 0.4.0)
406416
railties (>= 5.0)
407417
websocket (1.2.8)
408-
websocket-driver (0.6.5)
418+
websocket-driver (0.7.1)
409419
websocket-extensions (>= 0.1.0)
410420
websocket-extensions (0.1.4)
411421
woothee (1.10.0)
@@ -417,6 +427,7 @@ PLATFORMS
417427
ruby
418428

419429
DEPENDENCIES
430+
bootsnap
420431
bootstrap-sass
421432
capybara
422433
coffee-rails
@@ -449,15 +460,15 @@ DEPENDENCIES
449460
rack-host-redirect
450461
rack-mini-profiler
451462
rack-user_agent
452-
rails (~> 5.1.7)
463+
rails (~> 5.2.0)
453464
rails-controller-testing
454465
rails-html-sanitizer (~> 1.2.0)
455466
rake
456467
rspec-rails (~> 3.8)
457468
rspec-retry
458469
ruby-mp3info
459470
sass-rails (>= 5)
460-
scrivito (~> 1.15.0)
471+
scrivito (~> 1.16.0)
461472
scrivito_section_widgets
462473
scrivito_teaser_widget
463474
secure_headers
@@ -474,4 +485,4 @@ RUBY VERSION
474485
ruby 2.6.5p114
475486

476487
BUNDLED WITH
477-
1.17.2
488+
1.17.3

bin/setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ chdir APP_ROOT do
6969

7070
puts "\n== Restarting application server =="
7171
system! 'bin/rails restart'
72-
end
72+
end

bin/yarn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env ruby
2-
VENDOR_PATH = File.expand_path('..', __dir__)
3-
Dir.chdir(VENDOR_PATH) do
2+
APP_ROOT = File.expand_path('..', __dir__)
3+
Dir.chdir(APP_ROOT) do
44
begin
5-
exec "yarnpkg #{ARGV.join(" ")}"
5+
exec "yarnpkg", *ARGV
66
rescue Errno::ENOENT
77
$stderr.puts "Yarn executable was not detected in the system."
88
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"

config/application.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
module CoderdojoJp
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
12-
config.load_defaults 5.1
12+
config.load_defaults 5.2
1313

1414
# Settings in config/environments/* take precedence over those specified here.
15-
# Application configuration should go into files in config/initializers
16-
# -- all .rb files in that directory are automatically loaded.
15+
# Application configuration can go into files in config/initializers
16+
# -- all .rb files in that directory are automatically loaded after loading
17+
# the framework and any gems in your application.
1718

1819
# Timezone
1920
config.time_zone = 'Asia/Tokyo'

config/boot.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
22

33
require 'bundler/setup' # Set up gems listed in the Gemfile.
4+
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

config/cable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ test:
66

77
production:
88
adapter: redis
9-
url: redis://localhost:6379/1
9+
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
1010
channel_prefix: coderdojo_jp_production

config/environments/development.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@
1313
config.consider_all_requests_local = true
1414

1515
# Enable/disable caching. By default caching is disabled.
16-
if Rails.root.join('tmp/caching-dev.txt').exist?
16+
# Run rails dev:cache to toggle caching.
17+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
1718
config.action_controller.perform_caching = true
1819

1920
config.cache_store = :memory_store
2021
config.public_file_server.headers = {
21-
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
22+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
2223
}
2324
else
2425
config.action_controller.perform_caching = false
2526

2627
config.cache_store = :null_store
2728
end
2829

30+
# Store uploaded files on the local file system (see config/storage.yml for options)
31+
config.active_storage.service = :local
32+
2933
# Don't care if the mailer can't send.
3034
config.action_mailer.raise_delivery_errors = false
3135

@@ -37,6 +41,9 @@
3741
# Raise an error on page load if there are pending migrations.
3842
config.active_record.migration_error = :page_load
3943

44+
# Highlight code that triggered database queries in logs.
45+
config.active_record.verbose_query_logs = true
46+
4047
# Debug mode disables concatenation and preprocessing of assets.
4148
# This option may cause significant delays in view rendering with a large
4249
# number of complex assets.

config/environments/test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Configure public file server for tests with Cache-Control for performance.
1616
config.public_file_server.enabled = true
1717
config.public_file_server.headers = {
18-
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
18+
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
1919
}
2020

2121
# Show full error reports and disable caching.
@@ -27,6 +27,10 @@
2727

2828
# Disable request forgery protection in test environment.
2929
config.action_controller.allow_forgery_protection = false
30+
31+
# Store uploaded files on the local file system in a temporary directory
32+
config.active_storage.service = :test
33+
3034
config.action_mailer.perform_caching = false
3135

3236
# Tell Action Mailer not to deliver emails to the real world.
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Be sure to restart your server when you modify this file.
22

3-
# ApplicationController.renderer.defaults.merge!(
4-
# http_host: 'example.org',
5-
# https: false
6-
# )
3+
# ActiveSupport::Reloader.to_prepare do
4+
# ApplicationController.renderer.defaults.merge!(
5+
# http_host: 'example.org',
6+
# https: false
7+
# )
8+
# end

0 commit comments

Comments
 (0)