diff options
author | Xavier Noria <fxn@hashref.com> | 2013-03-30 11:27:53 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-03-30 11:34:35 +0100 |
commit | 92d6dacc348a4e42d314c813a650ac578976d4c4 (patch) | |
tree | ad57fcea156b4bac6628f4b36487d79aecef7b79 /railties/lib/rails | |
parent | 2645f6844f7ae3eed0e03a786490e5e432d87d52 (diff) | |
download | rails-92d6dacc348a4e42d314c813a650ac578976d4c4.tar.gz rails-92d6dacc348a4e42d314c813a650ac578976d4c4.tar.bz2 rails-92d6dacc348a4e42d314c813a650ac578976d4c4.zip |
configure API generation lazily
Do the absolute bare minimum needed to define this task, no need to compute
gem paths everytime you call rake.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/api/task.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/railties/lib/rails/api/task.rb b/railties/lib/rails/api/task.rb index 4f183c80c8..1e6458cf93 100644 --- a/railties/lib/rails/api/task.rb +++ b/railties/lib/rails/api/task.rb @@ -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 |