Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade rails to 5.0.7 #1777

Merged
merged 2 commits into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
default['supermarket']['redis_jobq_url'] = nil
default['supermarket']['sentry_url'] = nil
default['supermarket']['api_item_limit'] = 100
default['supermarket']['rails_log_to_stdout'] = true

# ### Chef URL Settings
#
Expand Down
6 changes: 6 additions & 0 deletions src/supermarket/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ RedundantBegin:
Enabled: false
EachWithObject:
Enabled: false
Layout/SpaceInsideArrayLiteralBrackets:
Exclude:
- config/environments/production.rb
Lint/UselessAssignment:
Exclude:
- config.rb
Expand All @@ -42,6 +45,9 @@ Metrics/PerceivedComplexity:
Enabled: false
Style/SymbolArray:
EnforcedStyle: brackets
Style/MixinUsage:
Exclude:
- bin/*
Style/NumericLiterals:
Enabled: false
Style/RaiseArgs:
Expand Down
1 change: 1 addition & 0 deletions src/supermarket/.rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Metrics/ModuleLength:
# Offense count: 1
Rails/FilePath:
Exclude:
- 'config/environments/development.rb'
- 'lib/tasks/spec/javascripts.rake'

Rails/HasManyOrHasOneDependent:
Expand Down
10 changes: 4 additions & 6 deletions src/supermarket/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ group :doc do
end

group :development do
gem 'faker'
gem 'guard'
gem 'guard-rspec', require: false
gem 'guard-rubocop', require: false
Expand All @@ -69,13 +68,10 @@ end
group :test do
gem 'capybara'
gem 'capybara-screenshot'
gem 'factory_girl_rails', require: false
gem 'poltergeist'

gem 'shoulda-matchers', '~> 2.8'

gem 'database_cleaner'
gem 'poltergeist'
gem 'rails-controller-testing'
gem 'shoulda-matchers', '~> 2.8'
gem 'vcr', require: false
gem 'webmock', require: false
end
Expand All @@ -84,6 +80,8 @@ group :development, :test do
gem 'brakeman'
gem 'bundler-audit', git: 'https://github.com/rubysec/bundler-audit.git', ref: '4e32fca'
gem 'byebug'
gem 'factory_bot_rails', require: false
gem 'faker'
gem 'launchy'
gem 'mail_view'
gem 'pry-rails'
Expand Down
101 changes: 51 additions & 50 deletions src/supermarket/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,41 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.3)
actionpack (= 5.0.3)
actioncable (5.0.7)
actionpack (= 5.0.7)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.3)
actionpack (= 5.0.3)
actionview (= 5.0.3)
activejob (= 5.0.3)
actionmailer (5.0.7)
actionpack (= 5.0.7)
actionview (= 5.0.7)
activejob (= 5.0.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.3)
actionview (= 5.0.3)
activesupport (= 5.0.3)
actionpack (5.0.7)
actionview (= 5.0.7)
activesupport (= 5.0.7)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.3)
activesupport (= 5.0.3)
actionview (5.0.7)
activesupport (= 5.0.7)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.3)
activesupport (= 5.0.3)
activejob (5.0.7)
activesupport (= 5.0.7)
globalid (>= 0.3.6)
activemodel (5.0.3)
activesupport (= 5.0.3)
activerecord (5.0.3)
activemodel (= 5.0.3)
activesupport (= 5.0.3)
activemodel (5.0.7)
activesupport (= 5.0.7)
activerecord (5.0.7)
activemodel (= 5.0.7)
activesupport (= 5.0.7)
arel (~> 7.0)
activesupport (5.0.3)
activesupport (5.0.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
Expand Down Expand Up @@ -162,7 +162,7 @@ GEM
connection_pool (2.2.1)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.3)
crass (1.0.4)
css_parser (1.5.0)
addressable
cucumber-core (3.2.1)
Expand All @@ -185,10 +185,10 @@ GEM
et-orbi (1.1.5)
tzinfo
execjs (2.7.0)
factory_girl (4.8.0)
factory_bot (4.11.1)
activesupport (>= 3.0.0)
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
factory_bot_rails (4.11.1)
factory_bot (~> 4.11.1)
railties (>= 3.0.0)
faker (1.7.3)
i18n (~> 0.5)
Expand All @@ -213,7 +213,7 @@ GEM
raabro (~> 1.1)
fuzzyurl (0.9.0)
gherkin (5.1.0)
globalid (0.4.0)
globalid (0.4.1)
activesupport (>= 4.2.0)
guard (2.14.1)
formatador (>= 0.2.4)
Expand All @@ -240,7 +240,7 @@ GEM
htmlentities (4.3.4)
httparty (0.15.2)
multi_xml (>= 0.5.2)
i18n (0.9.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
iniparse (1.4.4)
Expand Down Expand Up @@ -282,15 +282,16 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.0.12)
mail (2.6.5)
mime-types (>= 1.16, < 4)
mail (2.7.1)
mini_mime (>= 0.1.1)
mail_view (2.0.4)
tilt
method_source (0.8.2)
mime-types (3.1)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mime-types-data (3.2018.0812)
mimemagic (0.3.2)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
mixlib-archive (0.4.18)
Expand Down Expand Up @@ -318,7 +319,7 @@ GEM
net-ssh-gateway (>= 1.2.0)
net-telnet (0.1.1)
newrelic_rpm (4.1.0.333)
nio4r (2.0.0)
nio4r (2.3.1)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
notiffany (0.1.1)
Expand Down Expand Up @@ -400,17 +401,17 @@ GEM
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.3)
actioncable (= 5.0.3)
actionmailer (= 5.0.3)
actionpack (= 5.0.3)
actionview (= 5.0.3)
activejob (= 5.0.3)
activemodel (= 5.0.3)
activerecord (= 5.0.3)
activesupport (= 5.0.3)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.3)
rails (5.0.7)
actioncable (= 5.0.7)
actionmailer (= 5.0.7)
actionpack (= 5.0.7)
actionview (= 5.0.7)
activejob (= 5.0.7)
activemodel (= 5.0.7)
activerecord (= 5.0.7)
activesupport (= 5.0.7)
bundler (>= 1.3.0)
railties (= 5.0.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.1)
actionpack (~> 5.x)
Expand All @@ -421,9 +422,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.0.3)
actionpack (= 5.0.3)
activesupport (= 5.0.3)
railties (5.0.7)
actionpack (= 5.0.7)
activesupport (= 5.0.7)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
Expand Down Expand Up @@ -540,7 +541,7 @@ GEM
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
Expand All @@ -553,7 +554,7 @@ GEM
tomlrb (1.2.4)
treetop (1.6.10)
polyglot (~> 0.3)
tzinfo (1.2.4)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
Expand Down Expand Up @@ -582,7 +583,7 @@ GEM
hashdiff
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
websocket-extensions (0.1.3)
with_env (1.1.0)
wmi-lite (1.0.0)
xml-simple (1.1.5)
Expand All @@ -608,7 +609,7 @@ DEPENDENCIES
database_cleaner
ddtrace
dotenv
factory_girl_rails
factory_bot_rails
faker
fieri!
foreman
Expand Down Expand Up @@ -669,4 +670,4 @@ DEPENDENCIES
yard

BUNDLED WITH
1.16.6
1.17.0
3 changes: 2 additions & 1 deletion src/supermarket/bin/setup
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Expand All @@ -9,7 +10,7 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

FileUtils.chdir APP_ROOT do
chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file.

Expand Down
3 changes: 2 additions & 1 deletion src/supermarket/bin/update
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Expand All @@ -9,7 +10,7 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

FileUtils.chdir APP_ROOT do
chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.

Expand Down
2 changes: 1 addition & 1 deletion src/supermarket/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
config.consider_all_requests_local = true

# Enable/disable caching. By default caching is disabled.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true

config.cache_store = :memory_store
Expand Down
22 changes: 15 additions & 7 deletions src/supermarket/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true

# default production log level has historically been WARN
# TODO: consider setting to DEBUG so that the default provides
# maximum diagnostic information after ensuring log rotation
# schedule handles the increased output
config.log_level = (ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].downcase : 'warn').to_sym

# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]

# Use a different cache store in production.
config.cache_store = :redis_store, ENV['REDIS_URL'] || 'redis://localhost:6379/0/supermarket'

Expand Down Expand Up @@ -80,18 +89,17 @@

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'WARN')
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.log_level = (ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].downcase : 'warn').to_sym
# Prepend all log lines with the following tags.
config.log_tags = [:request_id]

# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')

if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Be sure to restart your server when you modify this file.

# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end
2 changes: 1 addition & 1 deletion src/supermarket/config/initializers/cookies_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :marshal
Rails.application.config.action_dispatch.cookies_serializer = :hybrid
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.

Rails.application.config.raise_on_unfiltered_parameters = true
Rails.application.config.action_controller.raise_on_unfiltered_parameters = true

# Enable per-form CSRF tokens. Previous versions had false.
Rails.application.config.action_controller.per_form_csrf_tokens = false
Expand Down
Loading