forked from mislav/contacts
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Rakefile
55 lines (47 loc) · 1.4 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
require 'spec/rake/spectask'
require 'rake/rdoctask'
task :default => :spec
spec_opts = 'spec/spec.opts'
spec_glob = FileList['spec/**/*_spec.rb']
libs = ['lib', 'spec', 'vendor/fakeweb/lib']
desc 'Run all specs in spec directory'
Spec::Rake::SpecTask.new(:spec) do |t|
t.libs = libs
t.spec_opts = ['--options', spec_opts]
t.spec_files = spec_glob
# t.warning = true
end
namespace :spec do
desc 'Analyze spec coverage with RCov'
Spec::Rake::SpecTask.new(:rcov) do |t|
t.libs = libs
t.spec_files = spec_glob
t.spec_opts = ['--options', spec_opts]
t.rcov = true
t.rcov_opts = lambda do
IO.readlines('spec/rcov.opts').map { |l| l.chomp.split(" ") }.flatten
end
end
desc 'Print Specdoc for all specs'
Spec::Rake::SpecTask.new(:doc) do |t|
t.libs = libs
t.spec_opts = ['--format', 'specdoc', '--dry-run']
t.spec_files = spec_glob
end
desc 'Generate HTML report'
Spec::Rake::SpecTask.new(:html) do |t|
t.libs = libs
t.spec_opts = ['--format', 'html:doc/spec.html', '--diff']
t.spec_files = spec_glob
t.fail_on_error = false
end
end
desc 'Generate RDoc documentation'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.add ['README.rdoc', 'MIT-LICENSE', 'lib/**/*.rb']
rdoc.main = 'README.rdoc'
rdoc.title = 'Ruby Contacts library'
rdoc.rdoc_dir = 'doc'
rdoc.options << '--inline-source'
rdoc.options << '--charset=UTF-8'
end