# Rake and rdoc help needed - target seems to be generated twi

**URL:** <https://www.ruby-forum.com/t/rake-and-rdoc-help-needed-target-seems-to-be-generated-twi/56863>\
**Category:** Ruby\
**Created:** [April 5, 2006, 3:15am UTC](https://www.ruby-forum.com/t/rake-and-rdoc-help-needed-target-seems-to-be-generated-twi/56863 "2006-04-05T03:15:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aseldo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e95f7d/32.png) [@aseldo](https://www.ruby-forum.com/u/aseldo)\
**Post date:** [April 5, 2006, 3:15am UTC](https://www.ruby-forum.com/t/rake-and-rdoc-help-needed-target-seems-to-be-generated-twi/56863/1 "2006-04-05T03:15:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aseldo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e95f7d/32.png) [@aseldo](https://www.ruby-forum.com/u/aseldo)\
**Post date:** [April 5, 2006, 6:24am UTC](https://www.ruby-forum.com/t/rake-and-rdoc-help-needed-target-seems-to-be-generated-twi/56863/2 "2006-04-05T06:24:44Z")

</div>

Kelly F. wrote:

> I set up some rake tasks to generate documentation for my rails app.  
> […]  
> 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.

I’m getting this:

* * *

$ rake gendocs --trace  
(in /media/hda5/jim/pgm/ruby/rake/docapi)  
\*\* Invoke gendocs (first\_time)  
\*\* Invoke doc/app/index.html (first\_time)  
\*\* Invoke doc/README\_FOR\_APP (first\_time, not\_needed)  
\*\* Invoke doc/REQUIREMENTS (first\_time, not\_needed)  
\*\* Invoke doc/DESIGN (first\_time, not\_needed)  
\*\* Invoke app/code.rb (first\_time, not\_needed)  
\*\* Execute doc/app/index.html  
rm doc/app/fr\_file\_index.html doc/app/fr\_class\_index.html  
doc/app/fr\_method\_index.html doc/app/index.html  
doc/app/files/doc/README\_FOR\_APP.html  
doc/app/files/doc/REQUIREMENTS.html doc/app/files/doc/DESIGN.html  
doc/app/files/app/code\_rb.html doc/app/classes/Code.html

```
                 README_FOR_APP:
                   REQUIREMENTS:
                         DESIGN:
                        code.rb: c

```

Generating HTML…

## Files: 4 Classes: 1 Modules: 0 Methods: 0 Elapsed: 0.079s \*\* Execute gendocs

It looks ok to me. Are you getting something different?

–  
– Jim W.
