# RDocTask and SVN

**URL:** <https://www.ruby-forum.com/t/rdoctask-and-svn/85743>\
**Category:** Ruby\
**Created:** [February 16, 2007, 12:00am UTC](https://www.ruby-forum.com/t/rdoctask-and-svn/85743 "2007-02-16T00:00:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [February 16, 2007, 12:00am UTC](https://www.ruby-forum.com/t/rdoctask-and-svn/85743/1 "2007-02-16T00:00:33Z")

</div>

Hi,  
I have a standard RDocTask in my rake file that creates my  
documentation. However everytime I run rake rdoc, it removes my  
document folder before rebuilding the new documentation which causes  
havoc with svn. SVN puts a ~ next to this folder in svn status (I  
assume because it thinks it’s still under version control but its .svn  
folder is missing from it), and its not fixed until i remove everything  
manually through svn commands. Is there a way to make this raketask  
play nicer with svn?  
Thanks,  
Ray

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [February 16, 2007, 12:22am UTC](https://www.ruby-forum.com/t/rdoctask-and-svn/85743/2 "2007-02-16T00:22:27Z")

</div>

On Fri, Feb 16, 2007, Raymond O’connor wrote:

> I have a standard RDocTask in my rake file that creates my  
> documentation. However everytime I run rake rdoc, it removes my  
> document folder before rebuilding the new documentation which causes  
> havoc with svn. SVN puts a ~ next to this folder in svn status (I  
> assume because it thinks it’s still under version control but its .svn  
> folder is missing from it), and its not fixed until i remove everything  
> manually through svn commands. Is there a way to make this raketask  
> play nicer with svn?

My personal preference is to svn:ignore any directory that contains  
solely content that is generated. That means my packages, rdoc, rcov,  
etc are not in svn. If ever someone wants to read them, they can run  
the tasks themselves.

This cuts down the size of your repository, the size and length (in  
time) of your checkouts, and allows more freedom for your users (if, for  
instance, they want to generate rdoc with a different template than you  
use).

Ben

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [February 16, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/rdoctask-and-svn/85743/3 "2007-02-16T20:13:51Z")

</div>

On Feb 15, 2007, at 15:00, Raymond O’connor wrote:

> I have a standard RDocTask in my rake file that creates my  
> documentation. However everytime I run rake rdoc, it removes my  
> document folder before rebuilding the new documentation which causes  
> havoc with svn. SVN puts a ~ next to this folder in svn status (I  
> assume because it thinks it’s still under version control but its .svn  
> folder is missing from it), and its not fixed until i remove  
> everything  
> manually through svn commands. Is there a way to make this raketask  
> play nicer with svn?

svn rm doc; svn ci -m “Don’t need doc checked in it is generated with  
rake rerdoc”

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [December 27, 2007, 12:53am UTC](https://www.ruby-forum.com/t/rdoctask-and-svn/85743/4 "2007-12-27T00:53:24Z")

</div>

Ben B. wrote:

> On Fri, Feb 16, 2007, Raymond O’connor wrote:
> 
> > I have a standard RDocTask in my rake file that creates my  
> > documentation. However everytime I run rake rdoc, it removes my  
> > document folder before rebuilding the new documentation which causes  
> > havoc with svn. SVN puts a ~ next to this folder in svn status (I  
> > assume because it thinks it’s still under version control but its .svn  
> > folder is missing from it), and its not fixed until i remove everything  
> > manually through svn commands. Is there a way to make this raketask  
> > play nicer with svn?
> 
> My personal preference is to svn:ignore any directory that contains  
> solely content that is generated. That means my packages, rdoc, rcov,  
> etc are not in svn. If ever someone wants to read them, they can run  
> the tasks themselves.

I agree with what you say, but this doesn’t solve the issue. This is  
because when you run a command like:

svn propset svn:ignore ‘\*’ doc

… the actual property itself is stored in the “.svn” directory of the  
target directory (“doc/.svn” in this case). So, this will work as long  
as that .svn directory remains intact. However, the rdoc tasks (i.e.  
“rake rdoc” and “rake rerdoc”) both clobber everything in the target  
directory when they run, including the “.svn” directory. So, if the  
rdoc task is ever run, you’ll have to go through the whole song and  
dance of setting the ignore property, etc again. Perhaps I’m missing  
something in your solution? I’ve searched all over the web for a  
solution to this, but all I’ve found so far is what you’re suggesting  
here. I’m on OS X Leopard with ruby 1.8.6 if it makes a difference.

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [December 27, 2007, 6:44am UTC](https://www.ruby-forum.com/t/rdoctask-and-svn/85743/5 "2007-12-27T06:44:35Z")

</div>

Ben Oakes wrote:

> Ben B. wrote:
> 
> > On Fri, Feb 16, 2007, Raymond O’connor wrote:
> > 
> > > I have a standard RDocTask in my rake file that creates my  
> > > documentation. However everytime I run rake rdoc, it removes my  
> > > document folder before rebuilding the new documentation which causes  
> > > havoc with svn. SVN puts a ~ next to this folder in svn status (I  
> > > assume because it thinks it’s still under version control but its .svn  
> > > folder is missing from it), and its not fixed until i remove everything  
> > > manually through svn commands. Is there a way to make this raketask  
> > > play nicer with svn?
> > 
> > My personal preference is to svn:ignore any directory that contains  
> > solely content that is generated. That means my packages, rdoc, rcov,  
> > etc are not in svn. If ever someone wants to read them, they can run  
> > the tasks themselves.
> 
> I agree with what you say, but this doesn’t solve the issue. This is  
> because when you run a command like:
> 
> svn propset svn:ignore ‘\*’ doc
> 
> … the actual property itself is stored in the “.svn” directory of the  
> target directory (“doc/.svn” in this case). So, this will work as long  
> as that .svn directory remains intact. However, the rdoc tasks (i.e.  
> “rake rdoc” and “rake rerdoc”) both clobber everything in the target  
> directory when they run, including the “.svn” directory. So, if the  
> rdoc task is ever run, you’ll have to go through the whole song and  
> dance of setting the ignore property, etc again. Perhaps I’m missing  
> something in your solution? I’ve searched all over the web for a  
> solution to this, but all I’ve found so far is what you’re suggesting  
> here. I’m on OS X Leopard with ruby 1.8.6 if it makes a difference.

I solved my own problem. I had tried both the above mentioned command  
as well as setting the ignore property from the root directory earlier.  
I don’t know what I did differently now, but the following worked for  
me:

- Get rid of the rdoc output directory (“doc” in my case)
- Run “mkdir doc” to get a fresh directory
- Run “svn propset svn:ignore ‘doc’ .” (note the period!) to ignore  
the entire “doc” directory

Why this didn’t work for me before, I don’t know. Hopefully this helps  
somebody out. 🙂

– Ben
