configure API generation lazily

Do the absolute bare minimum needed to define this task, no need to compute
gem paths everytime you call rake.
This commit is contained in:
Xavier Noria 2013-03-30 11:27:53 +01:00
parent 2645f6844f
commit 92d6dacc34
1 changed files with 11 additions and 7 deletions

View File

@ -64,15 +64,12 @@ module Rails
def initialize(name)
super
self.title = 'Ruby on Rails API'
self.rdoc_dir = api_dir
options << '-m' << api_main
options << '-e' << 'UTF-8'
# Every time rake runs this task is instantiated as all the rest.
# Be lazy computing stuff to have as light impact as possible to
# the rest of tasks.
before_running_rdoc do
configure_rdoc_files
load_and_configure_sdoc
configure_rdoc_files
setup_horo_variables
end
end
@ -84,6 +81,13 @@ module Rails
def load_and_configure_sdoc
require 'sdoc'
self.title = 'Ruby on Rails API'
self.rdoc_dir = api_dir
options << '-m' << api_main
options << '-e' << 'UTF-8'
options << '-f' << 'sdoc'
options << '-T' << 'rails'
rescue LoadError