forked from zapnap/sinatra-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
39 lines (33 loc) · 879 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
require 'spec/rake/spectask'
task :default => :test
task :test => :spec
if !defined?(Spec)
puts "spec targets require RSpec"
else
desc "Run all examples"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*.rb']
t.spec_opts = ['-cfs']
end
end
namespace :db do
desc 'Auto-migrate the database (destroys data)'
task :migrate => :environment do
DataMapper.auto_migrate!
end
desc 'Auto-upgrade the database (preserves data)'
task :upgrade => :environment do
DataMapper.auto_upgrade!
end
end
namespace :gems do
desc 'Install required gems'
task :install do
required_gems = %w{ sinatra rspec rack-test dm-core dm-validations
dm-aggregates haml }
required_gems.each { |required_gem| system "sudo gem install #{required_gem}" }
end
end
task :environment do
require 'environment'
end