Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Am I missing something by not installing ri and rdoc for gems?

Tags:

ruby

rubygems

I've never seen the point of installing the ri and rdoc for gems and my .gemrc file has --no-ri and --no-rdoc set. Since every gem includes ri and rdoc info, I just wondered if I'm missing something? Is there any advantage to installing the ri and rdoc for a gem?

Thanks

Chris

Summary

If you don't install the ri and rdoc, you don't lose anything of great value. I thought perhaps it got used in some of the IDEs (I'm an Emacs user) but that doesn't seem to be the case.

like image 584
Chris McCauley Avatar asked Dec 11 '09 10:12

Chris McCauley


1 Answers

The point of installing ri documentation is simply that you can use the "ri" command to access method-by-method documentation. For an example, try: "ri String#reverse". Exit by pressing "q".

To try out RDoc documentation, run "gem server" and then connect to localhost:8808 in your browser. I find it useful - you can even click on a method name to see the source code. Of course, you can just go into your gems folder and open the HTML files in the doc folder.

An alternate way to access RDoc is the gemdoc command. See http://www.stephencelis.com/2008/06/12/bashfully-yours-gem-shortcuts.html. That's quite handy, IMHO.

Anyway, you can be lazy and wait until you need the RDoc documentation, and then generate it with "gem rdoc ".

like image 145
Paolo Perrotta Avatar answered Oct 13 '22 00:10

Paolo Perrotta