2010-08-17 01:21:17 +00:00
|
|
|
require 'rake'
|
2011-12-02 13:42:46 +00:00
|
|
|
require 'rake/clean'
|
|
|
|
|
|
|
|
CLOBBER.include('doc', '.yardoc')
|
|
|
|
CLOBBER.uniq!
|
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-12-02 13:42:46 +00:00
|
|
|
'lib/**/*.rb', 'ext/**/*.c', '-',
|
|
|
|
'README.md', 'CHANGELOG.md', '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
|
|
|
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
|