-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
66 lines (60 loc) · 1.77 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
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/testtask'
FILES = FileList['Rakefile', 'CHANGELOG', 'LICENSE', 'README',
'lib/**/*.rb', 'test/**/*', 'example/*'].to_a
TESTS = FileList['test/ts_*.rb']
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.author = "Mike Pomraning"
s.summary = "An interface to service directories ala supervise/runsv"
s.name = 'svdir'
s.version = '0.2'
s.require_path = 'lib'
s.description = <<eodesc
The svdir package controls service directories, a scheme for reliably
controlling daemon processes as implemented in Dan Bernstein's daemontools
software ("supervise") or Gerit Pape's runit software ("runsv").
eodesc
s.files = FILES
s.test_files = TESTS
s.has_rdoc = true
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.package_dir = 'pkg'
pkg.need_tar = true
end
desc "Generate rdoc"
Rake::RDocTask.new("rdoc") do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.title = "svdir"
# Show source inline with line numbers
rdoc.options << "--inline-source" << "--line-numbers"
# Make the readme file the start page for the generated html
rdoc.options << '--main' << 'README'
rdoc.rdoc_files.include('lib/**/*.rb',
'CHANGELOG',
'README',
'LICENSE')
end
desc "Run included tests"
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = TESTS
t.libs << "lib"
end
desc "Run test coverage (rcov)"
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |t|
t.test_files = TESTS
t.libs << "test" << "lib"
t.rcov_opts << '--exclude /gems/,/Library/,/usr/,spec,lib/tasks'
end
rescue LoadError
task :rcov do
puts "Error - you seem to be missing 'rcov'"
exit 1
end
end