forked from integrity/integrity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
80 lines (68 loc) · 1.7 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
75
76
77
78
79
80
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
desc "Create the database"
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
desc "Re-generate stylesheet"
file "public/integrity.css" => "views/integrity.sass" do |f|
sh "sass views/integrity.sass > #{f.name}"
end
CLOBBER.include("doc/integrity.html")