Resolved deprecation issues with RDoc task.

This commit is contained in:
Bob Aman 2011-11-16 15:11:10 +03:00
parent 8b6a103bbf
commit a989f9ad51
1 changed files with 11 additions and 4 deletions

View File

@ -1,12 +1,19 @@
require 'rake/rdoctask' 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'
namespace :doc do namespace :doc do
desc 'Generate RDoc documentation' desc 'Generate RDoc documentation'
Rake::RDocTask.new do |rdoc| RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc' rdoc.rdoc_dir = 'doc'
rdoc.title = "#{PKG_NAME}-#{PKG_VERSION} Documentation" rdoc.title = "#{PKG_NAME}-#{PKG_VERSION} Documentation"
rdoc.options << '--line-numbers' << '--inline-source' << rdoc.options << '--line-numbers' << 'cattr_accessor=object' <<
'--accessor' << 'cattr_accessor=object' << '--charset' << 'utf-8' '--charset' << 'utf-8'
rdoc.template = "#{ENV['template']}.rb" if ENV['template'] rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.rdoc_files.include('README.md', 'CHANGELOG', 'LICENSE') rdoc.rdoc_files.include('README.md', 'CHANGELOG', 'LICENSE')
rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_files.include('lib/**/*.rb')