summaryrefslogtreecommitdiff
path: root/bin/setup
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-05-19 07:55:04 -0700
committermo khan <mo@mokhan.ca>2015-05-21 21:26:10 -0600
commite89bc7cb1467063ce65e3e78d77c8f4635132d0f (patch)
tree4e7664935ebe396ac0b048e0421e15a034f15b61 /bin/setup
parentb769c085489679d362ccacd4e5d514f663379089 (diff)
create a workout record for each recors in the sqlite db.
Diffstat (limited to 'bin/setup')
-rwxr-xr-xbin/setup37
1 files changed, 25 insertions, 12 deletions
diff --git a/bin/setup b/bin/setup
index 0fc0627..acdb2c1 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,16 +1,29 @@
#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'setup' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-require 'rubygems'
-require 'bundler/setup'
+# 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 check || bundle install"
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?("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"
-load Gem.bin_path('factory_girl_rails', 'setup')
+ puts "\n== Restarting application server =="
+ system "touch tmp/restart.txt"
+end