I''m trying to create a new rake task that will generate slightly customized RDoc documentation for my Rails app. So I''ve created a new task (shown below) in lib/tasks/doc.rake. It generates documentation OK, but it executes the task twice every time I ''rake doc:custom''. namespace :doc do desc "Generate customized documentation for this application" Rake::RDocTask.new(:custom) do |rdoc| rdoc.rdoc_dir = ''doc/app'' rdoc.title = "System Documentation" rdoc.options << ''--line-numbers'' << ''--all'' #<< ''--inline-source'' if ENV[''template''] puts "using template: #{ENV[''template'']}" rdoc.options << "--template=#{ENV[''template'']}" end rdoc.rdoc_files.include(''doc/README_FOR_APP'') rdoc.rdoc_files.include(''app/**/*.rb'') rdoc.rdoc_files.include(''lib/**/*.rb'') rdoc.rdoc_files.include(''vendor/plugins/**/*.rb'') rdoc.rdoc_files.include(''test/**/*.rb'') rdoc.rdoc_files.exclude(''lib/tasks/*'') end end I''m no Rake or RDoc wizard. I tried running rake --trace doc:custom, but the results didn''t seem to tell me anything: ** Invoke doc:custom (first_time) ** Invoke doc/app/index.html (first_time) ** Invoke doc/README_FOR_APP (first_time, not_needed) ... # ''Invokes'' for every file, followed by ''(first_time, not_needed)''. ** Execute doc/app/index.html rm -r doc/app ... # lists out all the files... Generating HTML... Files: 132 Classes: 173 Modules: 19 Methods: 1181 Elapsed: 52.921s rm -r doc/app ... # lists out all the files... Generating HTML... Files: 251 Classes: 287 Modules: 97 Methods: 1854 Elapsed: 106.524s ** Execute doc:custom Does the execute doc/app/index.html build all the doc, and then Execute doc:custom do it again? Before I dig into the internals of Rake, anyone have any ideas on what''s going on? Thanks.