Skip to content

Commit

Permalink
Upgrade to Rails 5.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
openfirmware committed Dec 8, 2017
1 parent 5ea2001 commit bbc9ded
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 63 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* [turbolinks from 2.5.3 to 5.0.1][turbolinks]
* [ruby-saml from 0.9.2 to 1.6.0][ruby-saml]
* [omniauth-facebook from 2.0.1 to 4.0.0][omniauth-facebook]
* [Upgrade Rails to 5.1.4][Rails 5.1.4]
* Add listen gem

## 2017-12-07

Expand Down Expand Up @@ -69,8 +71,8 @@
[high_voltage]: https://github.com/thoughtbot/high_voltage/blob/master/NEWS.md
[jbuilder]: https://github.com/rails/jbuilder/blob/master/CHANGELOG.md
[jquery-rails]: https://github.com/rails/jquery-rails/blob/master/CHANGELOG.md
[omniauth-gitlab]: https://github.com/linchus/omniauth-gitlab
[omniauth-facebook]: https://github.com/mkdynamic/omniauth-facebook/blob/master/CHANGELOG.md
[omniauth-gitlab]: https://github.com/linchus/omniauth-gitlab
[omniauth-google-oauth2]: https://github.com/zquestz/omniauth-google-oauth2/blob/master/CHANGELOG.md
[omniauth-shibboleth]: https://github.com/toyokazu/omniauth-shibboleth
[omniauth-twitter]: https://github.com/arunagw/omniauth-twitter
Expand All @@ -80,6 +82,7 @@
[rack-cache]: https://github.com/rtomayko/rack-cache/blob/master/CHANGES
[Rails 4.2.10]: http://weblog.rubyonrails.org/2017/9/27/Rails-4-2-10-released/
[Rails 5.0.6]: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-4-2-to-rails-5-0
[Rails 5.1.4]: http://weblog.rubyonrails.org/2017/9/7/Rails-5-1-4-and-5-0-6-released/
[rails_layout]: https://github.com/RailsApps/rails_layout/blob/master/CHANGELOG.textile
[rails_serve_static_assets]: https://github.com/heroku/rails_serve_static_assets/blob/master/CHANGELOG.md
[rails_stdout_logging]: https://github.com/heroku/rails_stdout_logging
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'

ruby '2.4.1'

gem 'rails', '5.0.6'
gem 'rails', '5.1.4'

gem 'dotenv-rails', '~> 2.2.1'

Expand Down Expand Up @@ -43,6 +43,7 @@ gem 'unicorn', '~> 5.3.1'

group :development, :test do
gem 'byebug', '~> 3.5.1'
gem 'listen', '~> 3.1.5'
gem 'rails_layout', '~> 1.0.24'
gem 'spring', '~> 2.0.2'
gem 'web-console', '~> 3.5.1'
Expand Down
88 changes: 47 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,44 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.6)
actionpack (= 5.0.6)
nio4r (>= 1.2, < 3.0)
actioncable (5.1.4)
actionpack (= 5.1.4)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.6)
actionpack (= 5.0.6)
actionview (= 5.0.6)
activejob (= 5.0.6)
actionmailer (5.1.4)
actionpack (= 5.1.4)
actionview (= 5.1.4)
activejob (= 5.1.4)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.6)
actionview (= 5.0.6)
activesupport (= 5.0.6)
actionpack (5.1.4)
actionview (= 5.1.4)
activesupport (= 5.1.4)
rack (~> 2.0)
rack-test (~> 0.6.3)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.6)
activesupport (= 5.0.6)
actionview (5.1.4)
activesupport (= 5.1.4)
builder (~> 3.1)
erubis (~> 2.7.0)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.6)
activesupport (= 5.0.6)
activejob (5.1.4)
activesupport (= 5.1.4)
globalid (>= 0.3.6)
activemodel (5.0.6)
activesupport (= 5.0.6)
activerecord (5.0.6)
activemodel (= 5.0.6)
activesupport (= 5.0.6)
arel (~> 7.0)
activesupport (5.0.6)
activemodel (5.1.4)
activesupport (= 5.1.4)
activerecord (5.1.4)
activemodel (= 5.1.4)
activesupport (= 5.1.4)
arel (~> 8.0)
activesupport (5.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
arel (8.0.0)
autoprefixer-rails (7.2.2)
execjs
bindex (0.5.0)
Expand All @@ -74,7 +74,7 @@ GEM
dotenv-rails (2.2.1)
dotenv (= 2.2.1)
railties (>= 3.2, < 5.2)
erubis (2.7.0)
erubi (1.7.0)
execjs (2.7.0)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
Expand All @@ -97,6 +97,10 @@ GEM
jwt (1.5.6)
kgio (2.11.0)
libv8 (3.16.14.19)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.1.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand Down Expand Up @@ -159,19 +163,19 @@ GEM
rack-openid (1.3.1)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.6)
actioncable (= 5.0.6)
actionmailer (= 5.0.6)
actionpack (= 5.0.6)
actionview (= 5.0.6)
activejob (= 5.0.6)
activemodel (= 5.0.6)
activerecord (= 5.0.6)
activesupport (= 5.0.6)
rack-test (0.8.2)
rack (>= 1.0, < 3)
rails (5.1.4)
actioncable (= 5.1.4)
actionmailer (= 5.1.4)
actionpack (= 5.1.4)
actionview (= 5.1.4)
activejob (= 5.1.4)
activemodel (= 5.1.4)
activerecord (= 5.1.4)
activesupport (= 5.1.4)
bundler (>= 1.3.0)
railties (= 5.0.6)
railties (= 5.1.4)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
Expand All @@ -181,9 +185,9 @@ GEM
rails_layout (1.0.41)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (5.0.6)
actionpack (= 5.0.6)
activesupport (= 5.0.6)
railties (5.1.4)
actionpack (= 5.1.4)
activesupport (= 5.1.4)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
Expand Down Expand Up @@ -219,6 +223,7 @@ GEM
ruby-openid (2.7.0)
ruby-saml (1.6.0)
nokogiri (>= 1.5.10)
ruby_dep (1.5.0)
sass (3.5.3)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
Expand Down Expand Up @@ -278,6 +283,7 @@ DEPENDENCIES
jbuilder (~> 2.7.0)
jquery-rails (~> 4.3.1)
libv8 (~> 3.16.14.19)
listen (~> 3.1.5)
omniauth (~> 1.7.1)
omniauth-browserid (~> 0.0.1)
omniauth-facebook (~> 4.0.0)
Expand All @@ -289,7 +295,7 @@ DEPENDENCIES
paranoia (~> 2.4.0)
pg (~> 0.21.0)
rack-cache (~> 1.7.1)
rails (= 5.0.6)
rails (= 5.1.4)
rails_layout (~> 1.0.24)
rails_serve_static_assets (~> 0.0.5)
rails_stdout_logging (~> 0.0.5)
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This app provides a centralized location to access all the Arctic Connect servic
## Requirements

* Ruby 2.4
* Rails 5.0.6
* Rails 5.1.4

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/map_notes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class MapNotesController < ApplicationController
protect_from_forgery except: :create
before_filter :require_login
before_action :require_login

responders :flash
respond_to :html, :json
Expand Down
4 changes: 4 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ chdir APP_ROOT do
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')


# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
Expand Down
11 changes: 11 additions & 0 deletions bin/yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
VENDOR_PATH = File.expand_path('..', __dir__)
Dir.chdir(VENDOR_PATH) do
begin
exec "yarnpkg #{ARGV.join(" ")}"
rescue Errno::ENOENT
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
end
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

module ArcticPortal
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
Expand Down
1 change: 1 addition & 0 deletions config/cable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test:
production:
adapter: redis
url: redis://localhost:6379/1
channel_prefix: arctic_portal_production
4 changes: 2 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800'
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
}
else
config.action_controller.perform_caching = false
Expand Down Expand Up @@ -50,5 +50,5 @@

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end
7 changes: 6 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
# `config/secrets.yml.key`.
config.read_encrypted_secrets = true

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
Expand Down Expand Up @@ -78,7 +83,7 @@
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

# Do not dump schema after migrations.
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=3600'
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
}

# Show full error reports and disable caching.
Expand Down
11 changes: 8 additions & 3 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path
Rails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
Rails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')

# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
Rails.application.config.assets.precompile += %w( map-notes.js map-notes.css )
14 changes: 14 additions & 0 deletions config/initializers/new_framework_defaults_5_1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.1 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.

# Make `form_with` generate non-remote forms.
Rails.application.config.action_view.form_with_generates_remote_forms = false

# Unknown asset fallback will return the path passed in when the given
# asset is not present in the asset pipeline.
# Rails.application.config.assets.unknown_asset_fallback = false
10 changes: 10 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
#
# This would use the information in config/locales/es.yml.
#
# The following keys must be escaped otherwise they will not be retrieved by
# the default I18n backend:
#
# true, false, on, off, yes, no
#
# Instead, surround them with single quotes.
#
# en:
# 'true': 'foo'
#
# To learn more, please read the Rails Internationalization guide
# available at http://guides.rubyonrails.org/i18n.html.

Expand Down
Loading

0 comments on commit bbc9ded

Please sign in to comment.