Hello,
I set up some rake tasks to generate documentation for my rails app. I
started with the doc:app task from rails and the rdoctask in rake
definitions. I'm learning rake so please go easy on me. Here is what I
came up with:
desc "Generate API Documentation"
SRC =
FileList['doc/README_FOR_APP','doc/REQUIREMENTS','doc/DESIGN','app/**/*.rb']
file "doc/app/index.html" => SRC do
rm Dir.glob('doc/app/**/*.html')
require 'rdoc/rdoc'
options = []
options << "-o" << 'doc/app'
options << "--title" << "Goals System"
RDoc::RDoc.new.document( options+SRC )
end
task :gendocs => "doc/app/index.html"
desc "Clobber API Documentation"
task :clobberdocs do
rm Dir.glob('doc/app/**/*.html')
end
When I do
rake --trace gendocs
It appears the documentation is generated, then deleted, then generated
again.
???
That's my question -- why does it generate, delete, and then generate it
again.
Additional background:
I'm trying to address 2 problems:
1. I want to include doc/REQUIREMENTS, and doc/DESIGN in my rdoc run.
2. We have a policy here of saving generated documentation in cvs. The
rdoctask that comes with rake does a rm_r, deleting everything in the target
directory including .CVS files. This makes it difficult to do a commit to
cvs.
Thank you.
-Kelly