Created
August 6, 2012 10:55
-
-
Save blake-simpson/3273435 to your computer and use it in GitHub Desktop.
Rake Setup task
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
task :devenv_check do | |
raise "You can only run this task in development mode!" unless Rails.env == 'development' | |
end | |
task :setup do | |
puts "Preparing to build databases. Running Rake tasks...." | |
#Remove all existing photo uploads and caches. TextMate users will appreciate this! | |
system "rm -rf public/uploads/*" | |
system "rm -rf tmp/cache/*" | |
system "rake devenv_check" | |
puts "Running 'rake db:drop'" | |
system "rake db:drop" | |
puts "Running 'rake db:create'" | |
system "rake db:create" | |
puts "Running 'rake db:migrate'" | |
system "rake db:migrate" | |
puts "Running 'rake db:seed'" | |
system "rake db:seed" | |
puts "Running 'rake db:test:prepare'" | |
system "rake db:test:prepare" | |
puts "Your databases and test environment are ready. Run 'rspec && cucumber' to test the application is working correctly." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment