aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-05-20 10:14:20 +0200
committerYves Senn <yves.senn@gmail.com>2014-05-30 11:15:56 +0200
commit7ba6b759106ba0cc4fdc67c2277e398c3d407d75 (patch)
treed2705d08937890986f476826a037e1b360589cb7 /railties/lib/rails
parent290de901ddd3fcba0b064b1cb985d98dfaed01a2 (diff)
downloadrails-7ba6b759106ba0cc4fdc67c2277e398c3d407d75.tar.gz
rails-7ba6b759106ba0cc4fdc67c2277e398c3d407d75.tar.bz2
rails-7ba6b759106ba0cc4fdc67c2277e398c3d407d75.zip
`bin/setup` script to bootstrap applications.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/bin/setup28
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/bin/setup b/railties/lib/rails/generators/rails/app/templates/bin/setup
new file mode 100644
index 0000000000..3d5f443406
--- /dev/null
+++ b/railties/lib/rails/generators/rails/app/templates/bin/setup
@@ -0,0 +1,28 @@
+require 'pathname'
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+Dir.chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file:
+
+ puts "== Installing dependencies =="
+ system "gem install bundler --conservative"
+ system "bundle install"
+
+ # puts "\n== Copying sample files =="
+ # unless File.exists?("config/database.yml")
+ # system "cp config/database.yml.sample config/database.yml"
+ # end
+
+ puts "\n== Preparing database =="
+ system "bin/rake db:setup"
+
+ puts "\n== Removing old logs and tempfiles =="
+ system "rm -f log/*"
+ system "rm -rf tmp/cache"
+
+ puts "\n== Restarting application server =="
+ system "touch tmp/restart.txt"
+end