2011-11-16 12:11:10 +00:00
|
|
|
require 'rubygems'
|
|
|
|
begin
|
|
|
|
# We prefer to use the RDoc gem over the site version.
|
|
|
|
gem 'rdoc'
|
|
|
|
rescue Gem::LoadError
|
|
|
|
end unless defined?(RDoc)
|
|
|
|
|
|
|
|
require 'rdoc/task'
|
2011-12-02 13:41:05 +00:00
|
|
|
require 'rake/clean'
|
|
|
|
|
|
|
|
CLOBBER.include('doc', 'ri')
|
|
|
|
CLOBBER.uniq!
|
2010-07-28 19:30:56 +00:00
|
|
|
|
|
|
|
namespace :doc do
|
2010-08-17 01:21:17 +00:00
|
|
|
desc 'Generate RDoc documentation'
|
2011-11-16 12:11:10 +00:00
|
|
|
RDoc::Task.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"
|
2011-11-16 12:11:10 +00:00
|
|
|
rdoc.options << '--line-numbers' << 'cattr_accessor=object' <<
|
|
|
|
'--charset' << 'utf-8'
|
2010-08-17 01:21:17 +00:00
|
|
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
2011-12-02 13:41:05 +00:00
|
|
|
rdoc.rdoc_files.include('README.md', 'CHANGELOG.md', 'LICENSE')
|
2010-08-17 01:21:17 +00:00
|
|
|
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
|
|
|
|
end
|