Skip to content

Commit 5c0679f

Browse files
committed
Upgrade to Rails 5.1.0
This go through the changes necessary to take the existing Rails 5.0.0.1 application up to Rails 5.1.0. We're not yet utilizing these new features, but we might shortly.
1 parent 16db6ec commit 5c0679f

File tree

13 files changed

+155
-121
lines changed

13 files changed

+155
-121
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
PORT=3000
12
POSTGRES_USER=coderjourney
23
POSTGRES_PASSWORD=abcd1234

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
3+
gem 'rails', '~> 5.1.0'
44
gem 'pg', '~> 0.18'
55
gem 'puma', '~> 3.0'
66
gem 'sass-rails', '~> 5.0'

Gemfile.lock

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (5.0.0.1)
5-
actionpack (= 5.0.0.1)
6-
nio4r (~> 1.2)
4+
actioncable (5.1.0)
5+
actionpack (= 5.1.0)
6+
nio4r (~> 2.0)
77
websocket-driver (~> 0.6.1)
8-
actionmailer (5.0.0.1)
9-
actionpack (= 5.0.0.1)
10-
actionview (= 5.0.0.1)
11-
activejob (= 5.0.0.1)
8+
actionmailer (5.1.0)
9+
actionpack (= 5.1.0)
10+
actionview (= 5.1.0)
11+
activejob (= 5.1.0)
1212
mail (~> 2.5, >= 2.5.4)
1313
rails-dom-testing (~> 2.0)
14-
actionpack (5.0.0.1)
15-
actionview (= 5.0.0.1)
16-
activesupport (= 5.0.0.1)
14+
actionpack (5.1.0)
15+
actionview (= 5.1.0)
16+
activesupport (= 5.1.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.0.0.1)
22-
activesupport (= 5.0.0.1)
21+
actionview (5.1.0)
22+
activesupport (= 5.1.0)
2323
builder (~> 3.1)
24-
erubis (~> 2.7.0)
24+
erubi (~> 1.4)
2525
rails-dom-testing (~> 2.0)
26-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
27-
activejob (5.0.0.1)
28-
activesupport (= 5.0.0.1)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27+
activejob (5.1.0)
28+
activesupport (= 5.1.0)
2929
globalid (>= 0.3.6)
30-
activemodel (5.0.0.1)
31-
activesupport (= 5.0.0.1)
32-
activerecord (5.0.0.1)
33-
activemodel (= 5.0.0.1)
34-
activesupport (= 5.0.0.1)
35-
arel (~> 7.0)
36-
activesupport (5.0.0.1)
30+
activemodel (5.1.0)
31+
activesupport (= 5.1.0)
32+
activerecord (5.1.0)
33+
activemodel (= 5.1.0)
34+
activesupport (= 5.1.0)
35+
arel (~> 8.0)
36+
activesupport (5.1.0)
3737
concurrent-ruby (~> 1.0, >= 1.0.2)
3838
i18n (~> 0.7)
3939
minitest (~> 5.1)
4040
tzinfo (~> 1.1)
41-
arel (7.1.4)
42-
autoprefixer-rails (6.5.4)
41+
arel (8.0.0)
42+
autoprefixer-rails (7.0.1)
4343
execjs
4444
bcrypt (3.1.11)
45+
bindex (0.5.0)
4546
bootstrap-sass (3.3.7)
4647
autoprefixer-rails (>= 5.2.1)
4748
sass (>= 3.3.4)
48-
builder (3.2.2)
49+
builder (3.2.3)
4950
byebug (9.0.6)
5051
clearance (1.15.1)
5152
bcrypt
5253
email_validator (~> 1.4)
5354
rails (>= 3.1)
54-
concurrent-ruby (1.0.2)
55-
debug_inspector (0.0.2)
55+
concurrent-ruby (1.0.5)
5656
email_validator (1.6.0)
5757
activemodel
58-
erubis (2.7.0)
58+
erubi (1.6.0)
5959
execjs (2.7.0)
60-
factory_girl (4.7.0)
60+
factory_girl (4.8.0)
6161
activesupport (>= 3.0.0)
62-
factory_girl_rails (4.7.0)
63-
factory_girl (~> 4.7.0)
62+
factory_girl_rails (4.8.0)
63+
factory_girl (~> 4.8.0)
6464
railties (>= 3.0.0)
65-
faker (1.6.6)
65+
faker (1.7.3)
6666
i18n (~> 0.5)
67-
ffi (1.9.14)
68-
globalid (0.3.7)
69-
activesupport (>= 4.1.0)
70-
i18n (0.7.0)
71-
jquery-rails (4.2.1)
67+
ffi (1.9.18)
68+
globalid (0.4.0)
69+
activesupport (>= 4.2.0)
70+
i18n (0.8.1)
71+
jquery-rails (4.3.1)
7272
rails-dom-testing (>= 1, < 3)
7373
railties (>= 4.2.0)
7474
thor (>= 0.14, < 2.0)
@@ -77,79 +77,79 @@ GEM
7777
rb-inotify (~> 0.9, >= 0.9.7)
7878
loofah (2.0.3)
7979
nokogiri (>= 1.5.9)
80-
mail (2.6.4)
80+
mail (2.6.5)
8181
mime-types (>= 1.16, < 4)
8282
method_source (0.8.2)
8383
mime-types (3.1)
8484
mime-types-data (~> 3.2015)
8585
mime-types-data (3.2016.0521)
8686
mini_portile2 (2.1.0)
87-
minitest (5.9.1)
87+
minitest (5.10.1)
8888
minitest-rails (3.0.0)
8989
minitest (~> 5.8)
9090
railties (~> 5.0)
91-
nio4r (1.2.1)
91+
nio4r (2.0.0)
9292
nokogiri (1.6.8.1)
9393
mini_portile2 (~> 2.1.0)
94-
pg (0.19.0)
95-
puma (3.6.0)
96-
rack (2.0.1)
94+
pg (0.20.0)
95+
puma (3.8.2)
96+
rack (2.0.2)
9797
rack-test (0.6.3)
9898
rack (>= 1.0)
99-
rails (5.0.0.1)
100-
actioncable (= 5.0.0.1)
101-
actionmailer (= 5.0.0.1)
102-
actionpack (= 5.0.0.1)
103-
actionview (= 5.0.0.1)
104-
activejob (= 5.0.0.1)
105-
activemodel (= 5.0.0.1)
106-
activerecord (= 5.0.0.1)
107-
activesupport (= 5.0.0.1)
99+
rails (5.1.0)
100+
actioncable (= 5.1.0)
101+
actionmailer (= 5.1.0)
102+
actionpack (= 5.1.0)
103+
actionview (= 5.1.0)
104+
activejob (= 5.1.0)
105+
activemodel (= 5.1.0)
106+
activerecord (= 5.1.0)
107+
activesupport (= 5.1.0)
108108
bundler (>= 1.3.0, < 2.0)
109-
railties (= 5.0.0.1)
109+
railties (= 5.1.0)
110110
sprockets-rails (>= 2.0.0)
111-
rails-dom-testing (2.0.1)
111+
rails-dom-testing (2.0.2)
112112
activesupport (>= 4.2.0, < 6.0)
113-
nokogiri (~> 1.6.0)
113+
nokogiri (~> 1.6)
114114
rails-html-sanitizer (1.0.3)
115115
loofah (~> 2.0)
116-
railties (5.0.0.1)
117-
actionpack (= 5.0.0.1)
118-
activesupport (= 5.0.0.1)
116+
railties (5.1.0)
117+
actionpack (= 5.1.0)
118+
activesupport (= 5.1.0)
119119
method_source
120120
rake (>= 0.8.7)
121121
thor (>= 0.18.1, < 2.0)
122-
rake (11.3.0)
122+
rake (12.0.0)
123123
rb-fsevent (0.9.8)
124-
rb-inotify (0.9.7)
124+
rb-inotify (0.9.8)
125125
ffi (>= 0.5.0)
126-
sass (3.4.22)
126+
sass (3.4.23)
127127
sass-rails (5.0.6)
128128
railties (>= 4.0.0, < 6)
129129
sass (~> 3.1)
130130
sprockets (>= 2.8, < 4.0)
131131
sprockets-rails (>= 2.0, < 4.0)
132132
tilt (>= 1.1, < 3)
133-
sprockets (3.7.0)
133+
sprockets (3.7.1)
134134
concurrent-ruby (~> 1.0)
135135
rack (> 1, < 3)
136136
sprockets-rails (3.2.0)
137137
actionpack (>= 4.0)
138138
activesupport (>= 4.0)
139139
sprockets (>= 3.0.0)
140-
thor (0.19.1)
141-
thread_safe (0.3.5)
142-
tilt (2.0.5)
143-
tzinfo (1.2.2)
140+
thor (0.19.4)
141+
thread_safe (0.3.6)
142+
tilt (2.0.7)
143+
tzinfo (1.2.3)
144144
thread_safe (~> 0.1)
145-
uglifier (3.0.3)
145+
uglifier (3.2.0)
146146
execjs (>= 0.3.0, < 3)
147-
web-console (3.4.0)
147+
web-console (3.5.0)
148148
actionview (>= 5.0)
149149
activemodel (>= 5.0)
150-
debug_inspector
150+
bindex (>= 0.4.0)
151151
railties (>= 5.0)
152-
websocket-driver (0.6.4)
152+
websocket-driver (0.6.5)
153153
websocket-extensions (>= 0.1.0)
154154
websocket-extensions (0.1.2)
155155

@@ -168,11 +168,11 @@ DEPENDENCIES
168168
nokogiri (= 1.6.8.1)
169169
pg (~> 0.18)
170170
puma (~> 3.0)
171-
rails (~> 5.0.0, >= 5.0.0.1)
171+
rails (~> 5.1.0)
172172
sass-rails (~> 5.0)
173173
tzinfo-data
174174
uglifier (>= 1.3.0)
175175
web-console
176176

177177
BUNDLED WITH
178-
1.13.1
178+
1.13.6

bin/setup

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ chdir APP_ROOT do
1818
system! 'gem install bundler --conservative'
1919
system('bundle check') || system!('bundle install')
2020

21+
# Install JavaScript dependencies if using Yarn
22+
# system('bin/yarn')
23+
24+
2125
# puts "\n== Copying sample files =="
2226
# unless File.exist?('config/database.yml')
2327
# cp 'config/database.yml.sample', 'config/database.yml'

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+
VENDOR_PATH = File.expand_path('..', __dir__)
3+
Dir.chdir(VENDOR_PATH) do
4+
begin
5+
exec "yarnpkg #{ARGV.join(" ")}"
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: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
require_relative 'boot'
22

3-
require "rails"
4-
# Pick the frameworks you want:
5-
require "active_model/railtie"
6-
require "active_job/railtie"
7-
require "active_record/railtie"
8-
require "action_controller/railtie"
9-
require "action_mailer/railtie"
10-
require "action_view/railtie"
11-
require "action_cable/engine"
12-
require "sprockets/railtie"
3+
require 'rails/all'
134

145
# Require the gems listed in Gemfile, including any gems
156
# you've limited to :test, :development, or :production.
167
Bundler.require(*Rails.groups)
178

189
module MealPlanner
1910
class Application < Rails::Application
11+
# Initialize configuration defaults for originally generated Rails version.
12+
config.load_defaults 5.1
13+
2014
# Settings in config/environments/* take precedence over those specified here.
2115
# Application configuration should go into files in config/initializers
2216
# -- all .rb files in that directory are automatically loaded.

config/cable.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ test:
77
production:
88
adapter: redis
99
url: redis://localhost:6379/1
10+
channel_prefix: meal_planner_production

config/environments/development.rb

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

1919
config.cache_store = :memory_store
2020
config.public_file_server.headers = {
21-
'Cache-Control' => 'public, max-age=172800'
21+
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
2222
}
2323
else
2424
config.action_controller.perform_caching = false

config/environments/test.rb

Lines changed: 1 addition & 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=3600'
18+
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
1919
}
2020

2121
# Show full error reports and disable caching.

config/initializers/assets.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
# Version of your assets, change this if you want to expire all your assets.
44
Rails.application.config.assets.version = '1.0'
55

6-
# Add additional assets to the asset load path
6+
# Add additional assets to the asset load path.
77
# Rails.application.config.assets.paths << Emoji.images_path
8+
# Add Yarn node_modules folder to the asset load path.
9+
Rails.application.config.assets.paths << Rails.root.join('node_modules')
810

911
# Precompile additional assets.
10-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11-
# Rails.application.config.assets.precompile += %w( search.js )
12+
# application.js, application.css, and all non-JS/CSS in the app/assets
13+
# folder are already added.
14+
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Be sure to restart your server when you modify this file.
2+
#
3+
# This file contains migration options to ease your Rails 5.1 upgrade.
4+
#
5+
# Once upgraded flip defaults one by one to migrate to the new default.
6+
#
7+
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
8+
9+
# Make `form_with` generate non-remote forms.
10+
Rails.application.config.action_view.form_with_generates_remote_forms = false
11+
12+
# Unknown asset fallback will return the path passed in when the given
13+
# asset is not present in the asset pipeline.
14+
# Rails.application.config.assets.unknown_asset_fallback = false

config/spring.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
%w(
2+
.ruby-version
3+
.rbenv-vars
4+
tmp/restart.txt
5+
tmp/caching-dev.txt
6+
).each { |path| Spring.watch(path) }

0 commit comments

Comments
 (0)