Skip to content

Commit 9ddca7b

Browse files
authored
Merge pull request heroku#55 from heroku/hf/upgrade-rails
upgrade rails to 5.2.3
2 parents 6037674 + 7f6bca1 commit 9ddca7b

26 files changed

+404
-176
lines changed

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
22
ruby '>= 2.3.5', '< 2.7'
33

44
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5-
gem 'rails'
5+
gem 'rails', '~> 5.2.0'
66
# Use postgresql as the database for Active Record
77
gem 'pg', '~> 0.18'
88
# Use SCSS for stylesheets
@@ -13,6 +13,8 @@ gem 'uglifier'
1313
gem 'coffee-rails'
1414
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
1515
# gem 'therubyracer', platforms: :ruby
16+
gem 'bootsnap', require: false
17+
gem 'listen'
1618

1719
# Use jquery as the JavaScript library
1820
gem 'jquery-rails'

Gemfile.lock

Lines changed: 79 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (5.1.4)
5-
actionpack (= 5.1.4)
4+
actioncable (5.2.3)
5+
actionpack (= 5.2.3)
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.3)
9+
actionpack (= 5.2.3)
10+
actionview (= 5.2.3)
11+
activejob (= 5.2.3)
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.3)
15+
actionview (= 5.2.3)
16+
activesupport (= 5.2.3)
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.3)
22+
activesupport (= 5.2.3)
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.3)
28+
activesupport (= 5.2.3)
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.3)
31+
activesupport (= 5.2.3)
32+
activerecord (5.2.3)
33+
activemodel (= 5.2.3)
34+
activesupport (= 5.2.3)
35+
arel (>= 9.0)
36+
activestorage (5.2.3)
37+
actionpack (= 5.2.3)
38+
activerecord (= 5.2.3)
39+
marcel (~> 0.3.1)
40+
activesupport (5.2.3)
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)
41-
arel (8.0.0)
45+
arel (9.0.0)
46+
bootsnap (1.4.5)
47+
msgpack (~> 1.0)
4248
builder (3.2.3)
4349
coffee-rails (4.2.2)
4450
coffee-script (>= 2.2.0)
@@ -47,14 +53,14 @@ GEM
4753
coffee-script-source
4854
execjs
4955
coffee-script-source (1.12.2)
50-
concurrent-ruby (1.0.5)
56+
concurrent-ruby (1.1.5)
5157
crass (1.0.4)
52-
erubi (1.7.0)
58+
erubi (1.8.0)
5359
execjs (2.7.0)
5460
ffi (1.9.18)
55-
globalid (0.4.1)
61+
globalid (0.4.2)
5662
activesupport (>= 4.2.0)
57-
i18n (0.9.3)
63+
i18n (1.6.0)
5864
concurrent-ruby (~> 1.0)
5965
jbuilder (2.7.0)
6066
activesupport (>= 4.2.0)
@@ -64,52 +70,62 @@ GEM
6470
railties (>= 4.2.0)
6571
thor (>= 0.14, < 2.0)
6672
json (1.8.6)
67-
loofah (2.2.2)
73+
listen (3.1.5)
74+
rb-fsevent (~> 0.9, >= 0.9.4)
75+
rb-inotify (~> 0.9, >= 0.9.7)
76+
ruby_dep (~> 1.2)
77+
loofah (2.2.3)
6878
crass (~> 1.0.2)
6979
nokogiri (>= 1.5.9)
70-
mail (2.7.0)
80+
mail (2.7.1)
7181
mini_mime (>= 0.1.1)
72-
method_source (0.9.0)
73-
mini_mime (1.0.0)
74-
mini_portile2 (2.3.0)
75-
minitest (5.11.1)
82+
marcel (0.3.3)
83+
mimemagic (~> 0.3.2)
84+
method_source (0.9.2)
85+
mimemagic (0.3.3)
86+
mini_mime (1.0.2)
87+
mini_portile2 (2.4.0)
88+
minitest (5.11.3)
89+
msgpack (1.3.1)
7690
multi_json (1.13.1)
77-
nio4r (2.2.0)
78-
nokogiri (1.8.2)
79-
mini_portile2 (~> 2.3.0)
91+
nio4r (2.5.1)
92+
nokogiri (1.10.4)
93+
mini_portile2 (~> 2.4.0)
8094
pg (0.19.0)
8195
puma (3.11.2)
82-
rack (2.0.3)
83-
rack-test (0.8.2)
96+
rack (2.0.7)
97+
rack-test (1.1.0)
8498
rack (>= 1.0, < 3)
85-
rails (5.1.4)
86-
actioncable (= 5.1.4)
87-
actionmailer (= 5.1.4)
88-
actionpack (= 5.1.4)
89-
actionview (= 5.1.4)
90-
activejob (= 5.1.4)
91-
activemodel (= 5.1.4)
92-
activerecord (= 5.1.4)
93-
activesupport (= 5.1.4)
99+
rails (5.2.3)
100+
actioncable (= 5.2.3)
101+
actionmailer (= 5.2.3)
102+
actionpack (= 5.2.3)
103+
actionview (= 5.2.3)
104+
activejob (= 5.2.3)
105+
activemodel (= 5.2.3)
106+
activerecord (= 5.2.3)
107+
activestorage (= 5.2.3)
108+
activesupport (= 5.2.3)
94109
bundler (>= 1.3.0)
95-
railties (= 5.1.4)
110+
railties (= 5.2.3)
96111
sprockets-rails (>= 2.0.0)
97112
rails-dom-testing (2.0.3)
98113
activesupport (>= 4.2.0)
99114
nokogiri (>= 1.6)
100-
rails-html-sanitizer (1.0.4)
115+
rails-html-sanitizer (1.2.0)
101116
loofah (~> 2.2, >= 2.2.2)
102-
railties (5.1.4)
103-
actionpack (= 5.1.4)
104-
activesupport (= 5.1.4)
117+
railties (5.2.3)
118+
actionpack (= 5.2.3)
119+
activesupport (= 5.2.3)
105120
method_source
106121
rake (>= 0.8.7)
107-
thor (>= 0.18.1, < 2.0)
108-
rake (12.3.0)
122+
thor (>= 0.19.0, < 2.0)
123+
rake (12.3.3)
109124
rb-fsevent (0.10.2)
110125
rb-inotify (0.9.10)
111126
ffi (>= 0.5.0, < 2)
112127
rdoc (4.3.0)
128+
ruby_dep (1.5.0)
113129
sass (3.5.5)
114130
sass-listen (~> 4.0.0)
115131
sass-listen (4.0.0)
@@ -126,37 +142,39 @@ GEM
126142
rdoc (~> 4.0)
127143
spring (2.0.2)
128144
activesupport (>= 4.2)
129-
sprockets (3.7.1)
145+
sprockets (3.7.2)
130146
concurrent-ruby (~> 1.0)
131147
rack (> 1, < 3)
132148
sprockets-rails (3.2.1)
133149
actionpack (>= 4.0)
134150
activesupport (>= 4.0)
135151
sprockets (>= 3.0.0)
136-
thor (0.20.0)
152+
thor (0.20.3)
137153
thread_safe (0.3.6)
138154
tilt (2.0.8)
139155
turbolinks (5.1.0)
140156
turbolinks-source (~> 5.1)
141157
turbolinks-source (5.1.0)
142-
tzinfo (1.2.4)
158+
tzinfo (1.2.5)
143159
thread_safe (~> 0.1)
144160
uglifier (4.1.4)
145161
execjs (>= 0.3.0, < 3)
146-
websocket-driver (0.6.5)
162+
websocket-driver (0.7.1)
147163
websocket-extensions (>= 0.1.0)
148-
websocket-extensions (0.1.3)
164+
websocket-extensions (0.1.4)
149165

150166
PLATFORMS
151167
ruby
152168

153169
DEPENDENCIES
170+
bootsnap
154171
coffee-rails
155172
jbuilder
156173
jquery-rails
174+
listen
157175
pg (~> 0.18)
158176
puma
159-
rails
177+
rails (~> 5.2.0)
160178
sass-rails
161179
sdoc
162180
spring
@@ -167,4 +185,4 @@ RUBY VERSION
167185
ruby 2.4.4p296
168186

169187
BUNDLED WITH
170-
1.16.5
188+
1.17.3

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
#!/usr/bin/env ruby
2-
begin
3-
load File.expand_path("../spring", __FILE__)
4-
rescue LoadError
5-
end
6-
APP_PATH = File.expand_path('../../config/application', __FILE__)
2+
APP_PATH = File.expand_path('../config/application', __dir__)
73
require_relative '../config/boot'
84
require 'rails/commands'

bin/rake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
#!/usr/bin/env ruby
2-
begin
3-
load File.expand_path("../spring", __FILE__)
4-
rescue LoadError
5-
end
62
require_relative '../config/boot'
73
require 'rake'
84
Rake.application.run

bin/setup

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env ruby
2+
require 'fileutils'
3+
include FileUtils
4+
5+
# path to your application root.
6+
APP_ROOT = File.expand_path('..', __dir__)
7+
8+
def system!(*args)
9+
system(*args) || abort("\n== Command #{args} failed ==")
10+
end
11+
12+
chdir APP_ROOT do
13+
# This script is a starting point to setup your application.
14+
# Add necessary setup steps to this file.
15+
16+
puts '== Installing dependencies =='
17+
system! 'gem install bundler --conservative'
18+
system('bundle check') || system!('bundle install')
19+
20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
23+
# puts "\n== Copying sample files =="
24+
# unless File.exist?('config/database.yml')
25+
# cp 'config/database.yml.sample', 'config/database.yml'
26+
# end
27+
28+
puts "\n== Preparing database =="
29+
system! 'bin/rails db:setup'
30+
31+
puts "\n== Removing old logs and tempfiles =="
32+
system! 'bin/rails log:clear tmp:clear'
33+
34+
puts "\n== Restarting application server =="
35+
system! 'bin/rails restart'
36+
end

bin/update

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env ruby
2+
require 'fileutils'
3+
include FileUtils
4+
5+
# path to your application root.
6+
APP_ROOT = File.expand_path('..', __dir__)
7+
8+
def system!(*args)
9+
system(*args) || abort("\n== Command #{args} failed ==")
10+
end
11+
12+
chdir APP_ROOT do
13+
# This script is a way to update your development environment automatically.
14+
# Add necessary update steps to this file.
15+
16+
puts '== Installing dependencies =='
17+
system! 'gem install bundler --conservative'
18+
system('bundle check') || system!('bundle install')
19+
20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
23+
puts "\n== Updating database =="
24+
system! 'bin/rails db:migrate'
25+
26+
puts "\n== Removing old logs and tempfiles =="
27+
system! 'bin/rails log:clear tmp:clear'
28+
29+
puts "\n== Restarting application server =="
30+
system! 'bin/rails restart'
31+
end

bin/yarn

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

config/application.rb

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require File.expand_path('../boot', __FILE__)
1+
require_relative 'boot'
22

33
require 'rails/all'
44

@@ -8,16 +8,12 @@
88

99
module RubyGettingStarted
1010
class Application < Rails::Application
11-
# Settings in config/environments/* take precedence over those specified here.
12-
# Application configuration should go into files in config/initializers
13-
# -- all .rb files in that directory are automatically loaded.
14-
15-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17-
# config.time_zone = 'Central Time (US & Canada)'
11+
# Initialize configuration defaults for originally generated Rails version.
12+
config.load_defaults 5.0
1813

19-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21-
# config.i18n.default_locale = :de
14+
# Settings in config/environments/* take precedence over those specified here.
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.
2218
end
2319
end

config/boot.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Set up gems listed in the Gemfile.
2-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
1+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
32

4-
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
3+
require 'bundler/setup' # Set up gems listed in the Gemfile.
4+
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

0 commit comments

Comments
 (0)