-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
43 lines (34 loc) · 1.03 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
require "bundler/gem_tasks"
require 'rake/testtask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the hark gem'
Rake::TestTask.new(:test) do |t|
t.libs << ['lib', 'test']
t.pattern = 'test/**/test_*.rb'
t.options = ["--verbose=verbose"] # (s[ilent], p[rogress], n[ormal], v[erbose])
end
desc "Generate documentation for the hark gem"
task :doc => ['doc:generate']
namespace :doc do
project_root = File.expand_path(File.dirname(__FILE__))
doc_destination = File.join(project_root, 'doc')
begin
require 'rdoc'
require 'yard'
require 'rdiscount'
YARD::Rake::YardocTask.new(:generate) do |t|
t.files = ['lib/**/*.rb']
t.options = ['--output-dir', doc_destination, '--readme', 'README.md']
end
rescue LoadError
desc "Generate YARD Documentation"
task :generate do
abort "Please install the yard and rdiscount gems to generate rdoc."
end
end
desc "Remove generated documentation"
task :clean do
rm_r doc_destination if File.exists?(doc_destination)
end
end