[Rubygems-developers] ri generation patch for Rubygems

Eric Hodel drbrain at segment7.net
Fri Feb 17 05:39:00 EST 2006


This is part of a rather interesting discovery I made while poking  
through the RDoc sources.  The following bit of code will allow ri to  
pick up documentation from gems:

begin
   require 'rubygems'
   Dir["#{Gem.path}/gems/*/ri"].each do |path|
     RI::Paths::PATH << path
   end
rescue LoadError
end

So the attached patch will cause gems with RDoc to also generate ri  
data.  It seems that there's a bunch of methods in doc_manager that  
didn't get called anymore, and I cleaned it up to make it much more  
explicit.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: doc_manager.rb.ri.patch
Type: application/octet-stream
Size: 3601 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rubygems-developers/attachments/20060217/7c44e43c/doc_manager.rb.ri.obj
-------------- next part --------------

So now I can do things like:

$ ri MogileFS::MogileFS#delete
---------------------------------------------- MogileFS::MogileFS#delete
      delete(key)
------------------------------------------------------------------------
      Removes +key+.

-- 
Eric Hodel - drbrain at segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com




More information about the Rubygems-developers mailing list