Created
June 14, 2009 07:56
-
-
Save karmi/129590 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :app do | |
desc "Install the application for local development" | |
task :install => :environment do | |
Rake::Task['app:bootstrap:exit_or_continue_in_production?'].invoke | |
Rake::Task['app:bootstrap'].invoke | |
Rake::Task['app:seed'].invoke | |
puts "\n*** Installed the application" | |
end | |
desc "Bootstrap the application -- create admin/admin user, migrate database, etc" | |
task :bootstrap => :environment do | |
# rake db:drop, db:create, db:migrate, insert admin user, etc | |
end | |
desc "Seed the application with data for development" | |
task :seed => :environment do | |
# Load data from fixtures/etc | |
end | |
namespace :bootstrap do | |
task :exit_or_continue_in_production? do | |
if Rails.env.production? | |
puts "!!!WARNING!!! This task will DESTROY your production database and RESET all application settings" | |
puts "Continue? y/n" | |
continue = STDIN.gets.chomp | |
unless continue == 'y' | |
puts "Exiting..." | |
exit! | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment