From 343dae2de593f699974667722b4db9911335f485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Sat, 7 Dec 2013 18:35:02 +0100 Subject: [PATCH] Add rake bootstrap task. --- README.md | 2 +- Rakefile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e9f70e..ed0a32a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ During each update it tweets the new pods. ```shell $ cp .env.sample .env $ vim .env -$ bundle install +$ rake bootstrap $ foreman start ``` diff --git a/Rakefile b/Rakefile index 8ed9c64..c986463 100644 --- a/Rakefile +++ b/Rakefile @@ -3,6 +3,37 @@ task :default => :spec #--------------------------------------# +def execute_command(command) + if ENV['VERBOSE'] + sh(command) + else + output = `#{command} 2>&1` + raise output unless $?.success? + end +end + +def title(title) + cyan_title = "\033[0;36m#{title}\033[0m" + puts + puts "-" * 80 + puts cyan_title + puts "-" * 80 + puts +end + +desc "Initializes your working copy to run the specs" +task :bootstrap do + title "Environment bootstrap" + + puts "Updating submodules" + execute_command "git submodule update --init --recursive" + + puts "Installing gems" + execute_command "bundle install" +end + +#--------------------------------------# + namespace :spec do desc "Run all the specs" task :all do