forked from mislav/contacts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
65 lines (56 loc) · 1.78 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
require 'spec/rake/spectask'
require 'rake/rdoctask'
require 'echoe'
Echoe.new('contacts', '0.2.8') do |p|
p.description = "Ruby library for consuming Google, Yahoo!, Flickr and Windows Live contact APIs"
p.url = "git://github.com/tamoyal/contacts.git"
p.author = "Mislav Marohnić"
p.email = "[email protected]"
p.ignore_pattern = ["tmp/*", "script/*"]
p.development_dependencies = []
end
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