Pages

Sponsorship

40% off your First Order with GoDaddy.com!

Jan 16, 2010

Rails: How to use a custom RDoc template from a rake task


I just need to do that, use a custom rdoc template to generate a documentation for a Rails project.

My main concern, regarding the different solutions I found on the web, was I didn’t want to have a template in the ruby installation directory but one that resides in a subdirectory of my rails application.

In fact it’s not a problem … when you find the good command. Here’s my rake task to generate the documentation (I put the Jamis Buck customized template in RAILS_ROOT/doc/rdoc_template/jamis.rb)


The important part is :
rdoc.template = "doc/rdoc_template/jamis.rb"

I tried to use the—template= and -T options in rdoc.options but it didn’t work… then I found that the RDocTask appends its template variable to the options passed to RDoc bypassing mine.

No comments:

Post a Comment