-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
43 lines (35 loc) · 843 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'rake'
task :default => [:test]
env = ENV["env"] || "development"
task :test do
require './app'
Bundler.require(:test)
require 'minitest/autorun'
Dir['./test/test_*.rb'].each {|file| require file }
end
namespace :db do
require './app'
set :environment, env.to_sym
load './settings.rb'
task :update do
puts "\nNon-destructively updating:\n\n"
puts settings.db
DataMapper.auto_upgrade!
end
task :migrate do
puts "\nDestructively update #{env} database? Y/N\n"
if $stdin.gets.chomp.downcase == 'y'
puts "\nDestructively updating:\n\n"
puts settings.db
DataMapper.auto_migrate!
end
end
end
task :server do
system("bundle exec rackup -p 9000 -s thin")
end
task :install do
system("bundle install")
Rake::Task["test"].invoke
Rake::Task["db:migrate"].invoke
end