Permalink
Browse files

configure API generation lazily

Do the absolute bare minimum needed to define this task, no need to compute
gem paths everytime you call rake.
  • Loading branch information...
1 parent 2645f68 commit 92d6dacc348a4e42d314c813a650ac578976d4c4 @fxn fxn committed Mar 30, 2013
Showing with 11 additions and 7 deletions.
  1. +11 −7 railties/lib/rails/api/task.rb
@@ -64,15 +64,12 @@ class Task < RDoc::Task
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 @@ def desc(description)
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

0 comments on commit 92d6dac

Please sign in to comment.