2010-08-17 01:21:17 +00:00
|
|
|
require 'rake/rdoctask'
|
2010-07-28 19:30:56 +00:00
|
|
|
|
|
|
|
namespace :doc do
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Generate RDoc documentation'
|
2010-07-28 19:30:56 +00:00
|
|
|
Rake::RDocTask.new do |rdoc|
|
2010-08-17 01:21:17 +00:00
|
|
|
rdoc.rdoc_dir = 'doc'
|
2010-07-28 19:30:56 +00:00
|
|
|
rdoc.title = "#{PKG_NAME}-#{PKG_VERSION} Documentation"
|
2010-08-17 01:21:17 +00:00
|
|
|
rdoc.options << '--line-numbers' << '--inline-source' <<
|
|
|
|
'--accessor' << 'cattr_accessor=object' << '--charset' << 'utf-8'
|
|
|
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
|
|
|
rdoc.rdoc_files.include('README', 'CHANGELOG', 'LICENSE')
|
|
|
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
2010-07-28 19:30:56 +00:00
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Generate ri locally for testing'
|
2010-07-28 19:30:56 +00:00
|
|
|
task :ri do
|
2010-08-17 01:21:17 +00:00
|
|
|
sh 'rdoc --ri -o ri .'
|
2010-07-28 19:30:56 +00:00
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Remove ri products'
|
2010-07-28 19:30:56 +00:00
|
|
|
task :clobber_ri do
|
2010-08-17 01:21:17 +00:00
|
|
|
rm_r 'ri' rescue nil
|
2010-07-28 19:30:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-08-17 01:21:17 +00:00
|
|
|
task 'clobber' => ['doc:clobber_rdoc', 'doc:clobber_ri']
|