This post originated from an RSS feed registered with Ruby Buzz
by Eric Hodel.
Original Post: RDoc's TemplatePage removed from Ruby
Feed Title: Segment7
Feed URL: http://blog.segment7.net/articles.rss
Feed Description: Posts about and around Ruby, MetaRuby, ruby2c, ZenTest and work at The Robot Co-op.
If you’ve got a custom RDoc template, it won’t work with the next release of 1.9. I’ve removed the custom TemplatePage and replaced it with an ERB-based version that works similarly.
This should make it much, much easier to write a custom RDoc template as you can now use arbitrary ruby code inside your templates.
It’s really easy to convert an old RDoc template to the upcoming version:
Replace this
With this
%blah%
<%= values["blah"] %>
!INCLUDE!
<%= template_include %>
HREF:aref:name
<%= href values["aref"], values["name"] %>
IF:blah
<% if values["blah"] then %>
IFNOT:blah
<% unless values["blah"] then %>
ENDIF:blah
<% end %>
START:blah
<% values["blah"].each do |blah| %>
END:blah
<% end %>
To make nested loops easier to convert, convert START statements to:
<% values["blah"].each do |blah| $stderr.puts blah.keys %>
So you can see what is being used inside which loop.
I’ve also removed the old_html template, as I don’t think anybody uses it anymore, and updated all the existing templates in RDoc to use ERB. (If somebody could double-check my work on the CHM and XML outputters, that would be great.)