forked from lokka/lokka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
49 lines (40 loc) · 1.02 KB
/
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
44
45
46
47
48
49
require './init'
desc 'Prepare test'
task 'test:prepare' => 'db:migrate' do
Lokka::Database.new.connect.seed
end
desc 'Migrate the Lokka database'
task 'db:migrate' do
puts 'Upgrading Database...'
Lokka::Database.new.connect.migrate
end
desc 'Execute seed script'
task 'db:seed' do
puts 'Initializing Database...'
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.logger.set_log STDERR, :debug, "SQL: ", true
Lokka::Database.new.connect.seed
end
desc 'Delete database'
task 'db:delete' do
puts 'Delete Database...'
Lokka::Database.new.connect.migrate!
end
desc 'Reset database'
task 'db:reset' => %w(db:delete db:seed)
desc 'Set database'
task 'db:setup' => %w(db:migrate db:seed)
desc 'Install gems'
task :bundle do
`bundle install --path vendor/bundle --without production test`
end
desc 'Install'
task :install => %w(bundle db:setup)
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = 'spec/*_spec.rb'
spec.rspec_opts = ['-cfs']
end
rescue LoadError => e
end