Set up Rubocop

This commit is contained in:
Kevin McConnell
2024-06-21 15:47:25 +01:00
parent e16323c70a
commit b9cf8c5e9d
15 changed files with 79 additions and 43 deletions
+8 -8
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
require "fileutils"
require 'fileutils'
# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
APP_ROOT = File.expand_path('..', __dir__)
def system!(*args)
system(*args, exception: true)
@@ -13,9 +13,9 @@ FileUtils.chdir APP_ROOT do
# 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 "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
@@ -23,11 +23,11 @@ FileUtils.chdir APP_ROOT do
# end
puts "\n== Preparing database =="
system! "bin/rails db:prepare"
system! 'bin/rails db:prepare'
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! "bin/rails restart"
system! 'bin/rails restart'
end