forked from integrity/integrity
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
74 lines (63 loc) · 1.54 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
require "rake/testtask"
require "rake/clean"
desc "Default: run all tests"
task :default => :test
desc "Run tests"
task :test => %w[test:unit test:acceptance]
namespace :test do
desc "Run unit tests"
Rake::TestTask.new(:unit) do |t|
t.libs << "test"
t.test_files = FileList["test/unit/*_test.rb"]
end
desc "Run acceptance tests"
Rake::TestTask.new(:acceptance) do |t|
t.libs << "test"
t.test_files = FileList["test/acceptance/*_test.rb"]
end
end
task :db do
require "init"
DataMapper.auto_upgrade!
end
desc "Clean-up build directory"
task :cleanup do
require "init"
Integrity::Build.all(:completed_at.not => nil).each { |build|
dir = Integrity.directory.join(build.id.to_s)
dir.rmtree if dir.directory?
}
end
namespace :jobs do
desc "Clear the delayed_job queue."
task :clear do
require "init"
require "integrity/builder/delayed"
Delayed::Job.delete_all
end
desc "Start a delayed_job worker."
task :work do
require "init"
require "integrity/builder/delayed"
Delayed::Worker.new.start
end
end
begin
namespace :resque do
require "resque/tasks"
desc "Start a Resque worker for Integrity"
task :work do
require "init"
ENV["QUEUE"] = "integrity"
Rake::Task["resque:resque:work"].invoke
end
end
rescue LoadError
end
desc "Generate HTML documentation."
file "doc/integrity.html" => ["doc/htmlize",
"doc/integrity.txt",
"doc/integrity.css"] do |f|
sh "cat doc/integrity.txt | doc/htmlize > #{f.name}"
end
CLOBBER.include("doc/integrity.html")