app: update code to Rails 6.1

This commit is contained in:
Pierre de La Morinerie 2021-02-16 15:14:43 +00:00
parent de9fab701a
commit 5990439ab7
25 changed files with 310 additions and 87 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/env ruby
require 'fileutils'
require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
@ -9,10 +9,11 @@ def system!(*args)
end
FileUtils.chdir APP_ROOT do
# This script is a starting point to setup your application.
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts "\n== Installing dependencies =="
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
@ -29,11 +30,11 @@ FileUtils.chdir APP_ROOT do
# Create the database, load the schema, and initialize it with the seed data
puts "\n== Preparing database =="
system! 'bin/rails db:setup'
system! 'bin/rails db:prepare'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Done =="
puts "You can now start the application server with `bin/rails server`."
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end