forked from integrity/integrity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
58 lines (46 loc) · 1.22 KB
/
Rakefile
File metadata and controls
58 lines (46 loc) · 1.22 KB
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
require "rake/testtask"
def spec
@spec ||= begin
require "rubygems/specification"
eval(File.read("integrity.gemspec"))
end
end
desc "Default: run all tests"
task :default => :test
desc "Launch Integrity real quick"
task :launch do
ruby "bin/integrity launch"
end
desc "Run tests"
task :test => %w(test:units test:acceptance)
namespace :test do
desc "Run unit tests"
Rake::TestTask.new(:units) do |t|
t.test_files = FileList["test/unit/*_test.rb"]
end
desc "Run acceptance tests"
Rake::TestTask.new(:acceptance) do |t|
t.test_files = FileList["test/acceptance/*_test.rb"]
end
end
desc "Special task for running tests on <http://builder.integrityapp.com>"
task :ci do
require "metric_fu"
Rake::Task["test"].invoke
metrics = %w(flay flog:all reek roodi saikuro)
metrics.each { |m| Rake::Task["metrics:#{m}"].invoke }
rm_rf "/var/www/integrity-metrics"
mv "tmp/metric_fu", "/var/www/integrity-metrics"
File.open("/var/www/integrity-metrics/index.html", "w") { |f|
f.puts "<ul>"
metrics.map { |m| m.split(":").first }.each { |m|
f.puts %Q(<li><a href="/#{m}">#{m}</a></li>)
}
f.puts "</ul>"
}
end
begin
require "mg"
MG.new("integrity.gemspec")
rescue LoadError
end