[Rubygems-developers] PATCH: option to incorporate RDoc into ri

John Wells lists at sourceillustrated.com
Tue Jan 31 11:20:26 EST 2006


Guys,

Attached, please find a proposed patch to add an --ri flag to the rdoc
command to incorporate the rdoc into the system ri directory.

Note, the patch doesn't provide this option on gem install, only on
actually running the rdoc command. Also, you must do this step separately
(i.e., running --ri doesn't include generation of the HTML), as doing both
generates a very strange error, and I suspect the existing commented out
code indicates someone else had run across this.

Also note I don't offer the capability of removing the ri info on
uninstall, only a note stating that you should do it. I spent a lot of
time going down the path to do this and got it close to working, but the
problem is that the rdoc code doesn't distinguish (afaict) between classes
that are system classes or shared between other classes...it simply
updates or replaces them. So, for example, if I generate the ri for the
Ferret gem, when I go to remove it I'm presented with three top level
classes: Ferret, String and Thread. Ferret is obviously the one I'd like
to remove, but I really *don't* want to remove String and Thread. If I'm
mistaken here, please let me know and I'll research further.

I'm very open to suggestions or comments. I find this a very useful
addition, as it is very helpful to have gem docs available at your
fingertips, and often gem_server is a bit too much for my needs.

Also, as I started to think about how one might test this I quickly found
I possessed more questions than answers. I suppose I can check for
existence for each of the classes by reimplementing
Generators::RIGenerator#generate to get a list of the top level classes
found for a gem and then make sure a directory exists for each in the
system ri directory, but not sure this is sufficient. Additionally, this
would suppose there were some sort of prexisting gem on every system that
I could generate ri for, test for existence, and then delete.

Anyway, I'm open to thoughts on this. I want to do it the right way and
would value your opinions.

Thanks!
John





-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_option_for_ri.patch
Type: text/x-patch
Size: 4004 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rubygems-developers/attachments/20060131/eae2cc9e/add_option_for_ri-0001.bin


More information about the Rubygems-developers mailing list