forked from sr/git-wiki
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
73 lines (64 loc) · 1.67 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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
task :default => :test
desc "Run tests"
task :test do
errors = ['test:git_wiki', 'test:webapp'].collect do |t|
begin
Rake::Task[t].invoke
nil
rescue => e
t
end
end
errors.compact!
abort "Testing failed on: #{errors.inspect}" unless errors.empty?
end
desc "Create Docs"
task :doc do
errors = ['doc:git_wiki', 'doc:webapp'].collect do |t|
begin
Rake::Task[t].invoke
nil
rescue => e
t
end
end
errors.compact!
abort "Doc failed on: #{errors.inspect}" unless errors.empty?
end
desc "Remove Docs and Test Artifacts"
task :clean do |t|
sh "rm -rf doc"
end
namespace :test do
Rake::TestTask.new(:git_wiki) do |t|
t.pattern ='test/git_wiki/*.rb'
t.verbose = true
end
Rake::Task['test:git_wiki'].comment = "Test the git_wiki libraries"
Rake::TestTask.new(:webapp) do |t|
t.pattern ='test/webapp/*.rb'
t.verbose = true
end
Rake::Task['test:webapp'].comment = "Test the webapp"
end
namespace :doc do
Rake::RDocTask.new(:git_wiki) do |t|
t.rdoc_dir = 'doc/git_wiki'
t.title = 'Git Wiki'
t.options << '--line-numbers' << '--inline-source'
t.rdoc_files.include('lib/git_wiki.rb')
t.rdoc_files.include('lib/git_wiki/**/*.rb')
end
Rake::Task['doc:git_wiki'].comment = "Document the git_wiki libraries"
Rake::RDocTask.new(:webapp) do |t|
t.rdoc_dir = 'doc/webapp'
t.title = 'Git Wiki (Sinatra App)'
t.options << '--line-numbers' << '--inline-source'
t.rdoc_files.include('lib/webapp.rb')
t.rdoc_files.include('lib/webapp/**/*.rb')
end
Rake::Task['doc:webapp'].comment = "Document the sinatra app"
end