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 to Rails 6 #150

Merged
merged 2 commits into from
May 8, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
# https://devcenter.heroku.com/articles/heroku-local#set-up-your-local-environment-variables

PORT=3000

# PUMA_WORKERS=1
PUMA_THREADS=5
RAILS_MAX_THREADS=5
28 changes: 21 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore local config.
# Ignore bundler config.
/.bundle

# Ingore application config.
/.env

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
/spec/examples.txt
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
/.rubocop-*

# Ignore compiled assets.
/public/assets
# Ingore testing and debugging.
/spec/examples.txt
.byebug_history

# Ignore uploaded files in development.
/storage/*
!/storage/.keep

# Ignore compiled assets and node modules.
/node_modules
/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ gem "bootsnap", require: false
gem "pg"
gem "puma"
gem "rack-canonical-host"
gem "rails", "~> 5.2.3"
gem "rails", "~> 6.0.0.rc1"

# Front-endy
gem "autoprefixer-rails"
gem "bootstrap", "~> 4.3.1"
gem "jquery-rails"
gem "sass-rails", require: false # Only needed for generator (e.g. rail g controller Users)
gem "sassc-rails"
gem "simple_form"
gem "slim-rails"
Expand All @@ -32,7 +31,7 @@ end

group :development, :test do
gem "factory_bot_rails"
gem "rspec-rails"
gem "rspec-rails", "~> 4.0.0.beta2" # For Rails 6 support.
gem "rspec_junit_formatter"
gem "rubocop", require: false
gem "rubocop-performance", require: false
Expand Down
136 changes: 70 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,55 +1,68 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.3)
actionpack (= 5.2.3)
actioncable (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.3)
actionpack (= 5.2.3)
actionview (= 5.2.3)
activejob (= 5.2.3)
actionmailbox (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
activestorage (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
mail (>= 2.7.1)
actionmailer (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
actionview (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.3)
actionview (= 5.2.3)
activesupport (= 5.2.3)
actionpack (6.0.0.rc1)
actionview (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.3)
activesupport (= 5.2.3)
actiontext (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
activestorage (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
nokogiri (>= 1.8.5)
actionview (6.0.0.rc1)
activesupport (= 6.0.0.rc1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.3)
activesupport (= 5.2.3)
activejob (6.0.0.rc1)
activesupport (= 6.0.0.rc1)
globalid (>= 0.3.6)
activemodel (5.2.3)
activesupport (= 5.2.3)
activerecord (5.2.3)
activemodel (= 5.2.3)
activesupport (= 5.2.3)
arel (>= 9.0)
activestorage (5.2.3)
actionpack (= 5.2.3)
activerecord (= 5.2.3)
activemodel (6.0.0.rc1)
activesupport (= 6.0.0.rc1)
activerecord (6.0.0.rc1)
activemodel (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
activestorage (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
marcel (~> 0.3.1)
activesupport (5.2.3)
activesupport (6.0.0.rc1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.1, >= 2.1.4)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
annotate (2.7.5)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 13.0)
arel (9.0.0)
ast (2.4.0)
autoprefixer-rails (9.5.1)
autoprefixer-rails (9.5.1.1)
execjs
awesome_print (1.8.0)
better_errors (2.5.1)
Expand Down Expand Up @@ -139,30 +152,32 @@ GEM
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-timeout (0.5.1)
rails (5.2.3)
actioncable (= 5.2.3)
actionmailer (= 5.2.3)
actionpack (= 5.2.3)
actionview (= 5.2.3)
activejob (= 5.2.3)
activemodel (= 5.2.3)
activerecord (= 5.2.3)
activestorage (= 5.2.3)
activesupport (= 5.2.3)
rails (6.0.0.rc1)
actioncable (= 6.0.0.rc1)
actionmailbox (= 6.0.0.rc1)
actionmailer (= 6.0.0.rc1)
actionpack (= 6.0.0.rc1)
actiontext (= 6.0.0.rc1)
actionview (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
activemodel (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
activestorage (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
bundler (>= 1.3.0)
railties (= 5.2.3)
railties (= 6.0.0.rc1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.3)
actionpack (= 5.2.3)
activesupport (= 5.2.3)
railties (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (12.3.2)
rb-fsevent (0.10.3)
Expand All @@ -171,20 +186,20 @@ GEM
regexp_parser (1.4.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
rspec-expectations (3.8.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (3.8.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-rails (4.0.0.beta2)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-core (~> 3.8)
rspec-expectations (~> 3.8)
rspec-mocks (~> 3.8)
rspec-support (~> 3.8)
rspec-support (3.8.0)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
Expand All @@ -195,22 +210,11 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.6)
rubocop-performance (1.1.0)
rubocop (>= 0.67.0)
rubocop-performance (1.2.0)
rubocop (>= 0.68.0)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
rubyzip (1.2.2)
sass (3.7.3)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.0.1)
ffi (~> 1.9)
rake
Expand All @@ -220,7 +224,7 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (3.142.0)
selenium-webdriver (3.142.1)
childprocess (>= 0.5, < 2.0)
rubyzip (~> 1.2, >= 1.2.2)
simple_form (4.1.0)
Expand Down Expand Up @@ -270,6 +274,7 @@ GEM
websocket-extensions (0.1.3)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.1.6)

PLATFORMS
ruby
Expand All @@ -292,12 +297,11 @@ DEPENDENCIES
puma
rack-canonical-host
rack-timeout
rails (~> 5.2.3)
rspec-rails
rails (~> 6.0.0.rc1)
rspec-rails (~> 4.0.0.beta2)
rspec_junit_formatter
rubocop
rubocop-performance
sass-rails
sassc-rails
selenium-webdriver
simple_form
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Several common features and operational parameters can be set using environment
* `PORT` - Port to listen on (default: 3000).
* `WEB_CONCURRENCY` - Number of puma workers to spawn (default: 1).
* `RAILS_MAX_THREADS` - Threads per worker (default: 5).
* `RAILS_MIN_THREADS` - Threads per worker (default: 5).
* `DB_POOL` - Number of DB connections per pool (i.e. per worker) (default: RAILS_MAX_THREADS or 5).
* `RAILS_LOG_TO_STDOUT` - Log to standard out, good for Heroku (default: false).
* `RAILS_SERVE_STATIC_FILES` - Serve static assets, good for Heroku (default: false).
Expand Down
11 changes: 0 additions & 11 deletions app/assets/javascripts/cable.coffee.example

This file was deleted.

5 changes: 5 additions & 0 deletions app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked

# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
end
3 changes: 0 additions & 3 deletions bin/bundle

This file was deleted.

15 changes: 8 additions & 7 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env ruby
require "pathname"
require "fileutils"
include FileUtils

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
Expand All @@ -10,21 +8,24 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

chdir APP_ROOT do
# This script is a starting point to setup your application.
FileUtils.chdir APP_ROOT do
# This script is a way to setup or update your development environment automatically.
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
# Add necessary setup steps to this file.

puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install --jobs 4")

# Install JavaScript dependencies
system!("bin/yarn") if File.exist?("yarn.lock")

puts "\n== Copying sample files =="
cp ".env.sample", ".env" unless File.exist?(".env")
FileUtils.cp ".env.sample", ".env" unless File.exist?(".env")

puts "\n== Preparing database =="
system! "bin/rails db:create:all"
system! "bin/rails db:setup db:sample_data"
system! "bin/rails db:prepare"
system! "bin/rails db:sample_data"

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"
Expand Down