diff options
author | 2019-07-22 16:42:37 +0200 | |
---|---|---|
committer | 2019-07-22 16:42:37 +0200 | |
commit | d6c6a7ad94b2e0a00c1ef476da6b5cf59223863a (patch) | |
tree | aee743dec6669609a1601965c424dd6fd63533a1 /bin | |
parent | Migrate to Rails 5.0 (diff) | |
download | packages-5-d6c6a7ad94b2e0a00c1ef476da6b5cf59223863a.tar.gz packages-5-d6c6a7ad94b2e0a00c1ef476da6b5cf59223863a.tar.bz2 packages-5-d6c6a7ad94b2e0a00c1ef476da6b5cf59223863a.zip |
Run "rails app:update"
Merge all upstream changes for a new Rails 5.0 application.
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/rails | 6 | ||||
-rwxr-xr-x | bin/rake | 4 | ||||
-rwxr-xr-x | bin/setup | 29 |
3 files changed, 18 insertions, 21 deletions
@@ -1,8 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end -APP_PATH = File.expand_path('../../config/application', __FILE__) +APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' @@ -1,8 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end require_relative '../config/boot' require 'rake' Rake.application.run @@ -1,29 +1,34 @@ #!/usr/bin/env ruby require 'pathname' +require 'fileutils' +include FileUtils # path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) -Dir.chdir APP_ROOT do +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. - # Add necessary setup steps to this file: + # Add necessary setup steps to this file. - puts "== Installing dependencies ==" - system "gem install bundler --conservative" - system "bundle check || 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") - # system "cp config/database.yml.sample config/database.yml" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' # end puts "\n== Preparing database ==" - system "bin/rake db:setup" + system! 'bin/rails db:setup' puts "\n== Removing old logs and tempfiles ==" - system "rm -f log/*" - system "rm -rf tmp/cache" + system! 'bin/rails log:clear tmp:clear' puts "\n== Restarting application server ==" - system "touch tmp/restart.txt" + system! 'bin/rails restart' end |