Commit 689c41d7ae79c4166ad060a8a071b975319fdf8d
1 parent
daf56064
Exists in
master
and in
1 other branch
Add a bootstrap task
Showing
3 changed files
with
36 additions
and
1 deletions
Show diff stats
.gitignore
db/seeds.rb
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +require 'fileutils' | |
| 2 | + | |
| 3 | +namespace :errbit do | |
| 4 | + | |
| 5 | + desc "Copys of example config files" | |
| 6 | + task :copy_configs do | |
| 7 | + configs = { | |
| 8 | + 'config.example.yml' => 'config.yml', | |
| 9 | + 'deploy.example.rb' => 'deploy.rb', | |
| 10 | + 'mongoid.example.yml' => 'mongoid.yml' | |
| 11 | + } | |
| 12 | + | |
| 13 | + puts "Copying example config files..." | |
| 14 | + configs.each do |old, new| | |
| 15 | + if File.exists?("config/#{new}") | |
| 16 | + puts "-- Skipping config/#{new}: already exists" | |
| 17 | + else | |
| 18 | + puts "-- Copying config/#{old} to config/#{new}" | |
| 19 | + FileUtils.cp "config/#{old}", "config/#{new}" | |
| 20 | + end | |
| 21 | + end | |
| 22 | + end | |
| 23 | + | |
| 24 | + desc "Copy's over example files and seeds the database" | |
| 25 | + task :bootstrap do | |
| 26 | + Rake::Task['errbit:copy_configs'].execute | |
| 27 | + puts "\n" | |
| 28 | + Rake::Task['db:seed'].invoke | |
| 29 | + end | |
| 30 | + | |
| 31 | +end | |
| 0 | 32 | \ No newline at end of file | ... | ... |