2010-08-17 01:21:17 +00:00
|
|
|
require 'rake'
|
2010-08-10 04:44:14 +00:00
|
|
|
|
|
|
|
begin
|
2010-08-17 01:21:17 +00:00
|
|
|
require 'yard'
|
|
|
|
require 'yard/rake/yardoc_task'
|
2010-08-10 04:44:14 +00:00
|
|
|
|
|
|
|
namespace :doc do
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Generate Yardoc documentation'
|
2010-08-10 04:44:14 +00:00
|
|
|
YARD::Rake::YardocTask.new do |yardoc|
|
2010-08-17 01:21:17 +00:00
|
|
|
yardoc.name = 'yard'
|
|
|
|
yardoc.options = ['--verbose']
|
2010-08-10 05:01:21 +00:00
|
|
|
yardoc.files = [
|
2011-10-11 11:54:57 +00:00
|
|
|
'lib/**/*.rb', 'ext/**/*.c', 'README.md', 'CHANGELOG', 'LICENSE'
|
2010-08-10 05:01:21 +00:00
|
|
|
]
|
2010-08-10 04:44:14 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
task 'clobber' => ['doc:clobber_yard']
|
2010-08-10 04:44:14 +00:00
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Alias to doc:yard'
|
|
|
|
task 'doc' => 'doc:yard'
|
2010-08-10 04:44:14 +00:00
|
|
|
rescue LoadError
|
|
|
|
# If yard isn't available, it's not the end of the world
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Alias to doc:rdoc'
|
|
|
|
task 'doc' => 'doc:rdoc'
|
2010-08-10 04:44:14 +00:00
|
|
|
end
|