Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit 06f1cf4

Browse files
committed
Update to Rails 5.2
1 parent 3e4813e commit 06f1cf4

19 files changed

+216
-110
lines changed

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ end
77

88

99
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10-
gem 'rails', '~> 5.1.1'
10+
gem 'rails', '~> 5.2.0'
11+
# Boot large Ruby/Rails apps faster
12+
gem 'bootsnap', require: false
1113
# Use sqlite3 as the database for Active Record
1214
gem 'sqlite3'
1315
# Use Puma as the app server

Gemfile.lock

Lines changed: 71 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,54 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (5.1.4)
5-
actionpack (= 5.1.4)
4+
actioncable (5.2.0)
5+
actionpack (= 5.2.0)
66
nio4r (~> 2.0)
7-
websocket-driver (~> 0.6.1)
8-
actionmailer (5.1.4)
9-
actionpack (= 5.1.4)
10-
actionview (= 5.1.4)
11-
activejob (= 5.1.4)
7+
websocket-driver (>= 0.6.1)
8+
actionmailer (5.2.0)
9+
actionpack (= 5.2.0)
10+
actionview (= 5.2.0)
11+
activejob (= 5.2.0)
1212
mail (~> 2.5, >= 2.5.4)
1313
rails-dom-testing (~> 2.0)
14-
actionpack (5.1.4)
15-
actionview (= 5.1.4)
16-
activesupport (= 5.1.4)
14+
actionpack (5.2.0)
15+
actionview (= 5.2.0)
16+
activesupport (= 5.2.0)
1717
rack (~> 2.0)
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.4)
22-
activesupport (= 5.1.4)
21+
actionview (5.2.0)
22+
activesupport (= 5.2.0)
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.4)
28-
activesupport (= 5.1.4)
27+
activejob (5.2.0)
28+
activesupport (= 5.2.0)
2929
globalid (>= 0.3.6)
30-
activemodel (5.1.4)
31-
activesupport (= 5.1.4)
32-
activerecord (5.1.4)
33-
activemodel (= 5.1.4)
34-
activesupport (= 5.1.4)
35-
arel (~> 8.0)
36-
activesupport (5.1.4)
30+
activemodel (5.2.0)
31+
activesupport (= 5.2.0)
32+
activerecord (5.2.0)
33+
activemodel (= 5.2.0)
34+
activesupport (= 5.2.0)
35+
arel (>= 9.0)
36+
activestorage (5.2.0)
37+
actionpack (= 5.2.0)
38+
activerecord (= 5.2.0)
39+
marcel (~> 0.3.1)
40+
activesupport (5.2.0)
3741
concurrent-ruby (~> 1.0, >= 1.0.2)
38-
i18n (~> 0.7)
42+
i18n (>= 0.7, < 2)
3943
minitest (~> 5.1)
4044
tzinfo (~> 1.1)
4145
addressable (2.5.1)
4246
public_suffix (~> 2.0, >= 2.0.2)
43-
arel (8.0.0)
47+
arel (9.0.0)
4448
ast (2.3.0)
4549
bindex (0.5.0)
50+
bootsnap (1.3.1)
51+
msgpack (~> 1.0)
4652
builder (3.2.3)
4753
byebug (9.0.6)
4854
capybara (2.14.3)
@@ -55,69 +61,76 @@ GEM
5561
childprocess (0.7.0)
5662
ffi (~> 1.0, >= 1.0.11)
5763
concurrent-ruby (1.0.5)
58-
crass (1.0.2)
59-
erubi (1.7.0)
64+
crass (1.0.4)
65+
erubi (1.7.1)
6066
ffi (1.9.18)
61-
globalid (0.4.0)
67+
globalid (0.4.1)
6268
activesupport (>= 4.2.0)
63-
i18n (0.8.6)
69+
i18n (1.0.1)
70+
concurrent-ruby (~> 1.0)
6471
jbuilder (2.7.0)
6572
activesupport (>= 4.2.0)
6673
multi_json (>= 1.2)
6774
listen (3.1.5)
6875
rb-fsevent (~> 0.9, >= 0.9.4)
6976
rb-inotify (~> 0.9, >= 0.9.7)
7077
ruby_dep (~> 1.2)
71-
loofah (2.1.1)
78+
loofah (2.2.2)
7279
crass (~> 1.0.2)
7380
nokogiri (>= 1.5.9)
74-
mail (2.6.6)
75-
mime-types (>= 1.16, < 4)
81+
mail (2.7.0)
82+
mini_mime (>= 0.1.1)
83+
marcel (0.3.2)
84+
mimemagic (~> 0.3.2)
7685
method_source (0.9.0)
7786
mime-types (3.1)
7887
mime-types-data (~> 3.2015)
7988
mime-types-data (3.2016.0521)
89+
mimemagic (0.3.2)
90+
mini_mime (1.0.0)
8091
mini_portile2 (2.3.0)
81-
minitest (5.10.3)
92+
minitest (5.11.3)
93+
msgpack (1.2.4)
8294
multi_json (1.12.2)
83-
nio4r (2.1.0)
84-
nokogiri (1.8.1)
95+
nio4r (2.3.1)
96+
nokogiri (1.8.4)
8597
mini_portile2 (~> 2.3.0)
8698
parser (2.3.1.2)
8799
ast (~> 2.2)
88100
powerpack (0.1.1)
89101
public_suffix (2.0.5)
90102
puma (3.9.1)
91-
rack (2.0.3)
103+
rack (2.0.5)
92104
rack-proxy (0.6.2)
93105
rack
94-
rack-test (0.7.0)
106+
rack-test (1.0.0)
95107
rack (>= 1.0, < 3)
96-
rails (5.1.4)
97-
actioncable (= 5.1.4)
98-
actionmailer (= 5.1.4)
99-
actionpack (= 5.1.4)
100-
actionview (= 5.1.4)
101-
activejob (= 5.1.4)
102-
activemodel (= 5.1.4)
103-
activerecord (= 5.1.4)
104-
activesupport (= 5.1.4)
108+
rails (5.2.0)
109+
actioncable (= 5.2.0)
110+
actionmailer (= 5.2.0)
111+
actionpack (= 5.2.0)
112+
actionview (= 5.2.0)
113+
activejob (= 5.2.0)
114+
activemodel (= 5.2.0)
115+
activerecord (= 5.2.0)
116+
activestorage (= 5.2.0)
117+
activesupport (= 5.2.0)
105118
bundler (>= 1.3.0)
106-
railties (= 5.1.4)
119+
railties (= 5.2.0)
107120
sprockets-rails (>= 2.0.0)
108121
rails-dom-testing (2.0.3)
109122
activesupport (>= 4.2.0)
110123
nokogiri (>= 1.6)
111-
rails-html-sanitizer (1.0.3)
112-
loofah (~> 2.0)
113-
railties (5.1.4)
114-
actionpack (= 5.1.4)
115-
activesupport (= 5.1.4)
124+
rails-html-sanitizer (1.0.4)
125+
loofah (~> 2.2, >= 2.2.2)
126+
railties (5.2.0)
127+
actionpack (= 5.2.0)
128+
activesupport (= 5.2.0)
116129
method_source
117130
rake (>= 0.8.7)
118131
thor (>= 0.18.1, < 2.0)
119132
rainbow (2.1.0)
120-
rake (12.1.0)
133+
rake (12.3.1)
121134
rb-fsevent (0.9.8)
122135
rb-inotify (0.9.9)
123136
ffi (~> 1.0)
@@ -138,7 +151,7 @@ GEM
138151
spring-watcher-listen (2.0.1)
139152
listen (>= 2.7, < 4.0)
140153
spring (>= 1.2, < 3.0)
141-
sprockets (3.7.1)
154+
sprockets (3.7.2)
142155
concurrent-ruby (~> 1.0)
143156
rack (> 1, < 3)
144157
sprockets-rails (3.2.1)
@@ -148,7 +161,7 @@ GEM
148161
sqlite3 (1.3.13)
149162
thor (0.20.0)
150163
thread_safe (0.3.6)
151-
tzinfo (1.2.3)
164+
tzinfo (1.2.5)
152165
thread_safe (~> 0.1)
153166
unicode-display_width (1.1.0)
154167
web-console (3.5.1)
@@ -160,22 +173,23 @@ GEM
160173
activesupport (>= 4.2)
161174
rack-proxy (>= 0.6.1)
162175
railties (>= 4.2)
163-
websocket-driver (0.6.5)
176+
websocket-driver (0.7.0)
164177
websocket-extensions (>= 0.1.0)
165-
websocket-extensions (0.1.2)
178+
websocket-extensions (0.1.3)
166179
xpath (2.1.0)
167180
nokogiri (~> 1.3)
168181

169182
PLATFORMS
170183
ruby
171184

172185
DEPENDENCIES
186+
bootsnap
173187
byebug
174188
capybara (~> 2.13)
175189
jbuilder (~> 2.5)
176190
listen (>= 3.0.5, < 3.2)
177191
puma (~> 3.7)
178-
rails (~> 5.1.1)
192+
rails (~> 5.2.0)
179193
rubocop
180194
selenium-webdriver
181195
spring
@@ -186,4 +200,4 @@ DEPENDENCIES
186200
webpacker
187201

188202
BUNDLED WITH
189-
1.13.3
203+
1.16.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Dependency
44

5-
* [Rails 5.1](http://guides.rubyonrails.org/5_1_release_notes.html)
5+
* [Rails 5.2](http://guides.rubyonrails.org/5_2_release_notes.html)
66
* [Webpacker 3](http://weblog.rubyonrails.org/2017/8/30/webpacker-3-0/)
77

88
## Features

bin/bundle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env ruby
2-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
33
load Gem.bin_path('bundler', 'bundle')

bin/setup

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env ruby
2-
require 'pathname'
32
require 'fileutils'
43
include FileUtils
54

65
# path to your application root.
7-
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6+
APP_ROOT = File.expand_path('..', __dir__)
87

98
def system!(*args)
109
system(*args) || abort("\n== Command #{args} failed ==")
@@ -21,7 +20,6 @@ chdir APP_ROOT do
2120
# Install JavaScript dependencies if using Yarn
2221
# system('bin/yarn')
2322

24-
2523
# puts "\n== Copying sample files =="
2624
# unless File.exist?('config/database.yml')
2725
# cp 'config/database.yml.sample', 'config/database.yml'

bin/update

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env ruby
2-
require 'pathname'
32
require 'fileutils'
43
include FileUtils
54

65
# path to your application root.
7-
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6+
APP_ROOT = File.expand_path('..', __dir__)
87

98
def system!(*args)
109
system(*args) || abort("\n== Command #{args} failed ==")
@@ -18,6 +17,9 @@ chdir APP_ROOT do
1817
system! 'gem install bundler --conservative'
1918
system('bundle check') || system!('bundle install')
2019

20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
2123
puts "\n== Updating database =="
2224
system! 'bin/rails db:migrate'
2325

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
require "active_model/railtie"
66
require "active_job/railtie"
77
require "active_record/railtie"
8+
require "active_storage/engine"
89
require "action_controller/railtie"
910
require "action_mailer/railtie"
1011
require "action_view/railtie"
@@ -22,7 +23,8 @@ class Application < Rails::Application
2223
config.load_defaults 5.1
2324

2425
# Settings in config/environments/* take precedence over those specified here.
25-
# Application configuration should go into files in config/initializers
26-
# -- all .rb files in that directory are automatically loaded.
26+
# Application configuration can go into files in config/initializers
27+
# -- all .rb files in that directory are automatically loaded after loading
28+
# the framework and any gems in your application.
2729
end
2830
end

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: 2 additions & 2 deletions
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
10-
channel_prefix: webpakcer-react-exampl_production
9+
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10+
channel_prefix: webpakcer_react_exampl_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

4148
# Raises error for missing translations
4249
# config.action_view.raise_on_missing_translations = true

0 commit comments

Comments
 (0)