From 44fef4fe4cb9d4f30f129ff5a548395bc924c8fe Mon Sep 17 00:00:00 2001 From: Jasper Maes Date: Fri, 7 Dec 2018 19:15:06 +0100 Subject: Remove rails 4 support in CI, Gemfiles, bin/ and config/ --- bin/setup | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) (limited to 'bin/setup') diff --git a/bin/setup b/bin/setup index 34bb667087a..883825bc0a2 100755 --- a/bin/setup +++ b/bin/setup @@ -1,18 +1,12 @@ #!/usr/bin/env ruby -def rails5? - !%w[0 false].include?(ENV["RAILS5"]) -end - require "pathname" # path to your application root. APP_ROOT = Pathname.new File.expand_path("../../", __FILE__) -if rails5? - def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") - end +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") end Dir.chdir APP_ROOT do @@ -20,14 +14,8 @@ Dir.chdir APP_ROOT do # Add necessary setup steps to this file: puts "== Installing dependencies ==" - - if rails5? - system! "gem install bundler --conservative" - system("bundle check") || system!("bundle install") - else - system "gem install bundler --conservative" - system "bundle check || bundle install" - end + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") # puts "\n== Copying sample files ==" # unless File.exist?("config/database.yml") @@ -35,27 +23,11 @@ Dir.chdir APP_ROOT do # end puts "\n== Preparing database ==" - - if rails5? - system! "bin/rails db:setup" - else - system "bin/rake db:reset" - end + system! "bin/rails db:setup" puts "\n== Removing old logs and tempfiles ==" - - if rails5? - system! "bin/rails log:clear tmp:clear" - else - system "rm -f log/*" - system "rm -rf tmp/cache" - end + system! "bin/rails log:clear tmp:clear" puts "\n== Restarting application server ==" - - if rails5? - system! "bin/rails restart" - else - system "touch tmp/restart.txt" - end + system! "bin/rails restart" end -- cgit v1.2.3