Ruby Core & Ruby on Rails CHM Documentation
Today, my company’s internet provider managed to cut off the internet connection for the whole day! This made me wonder why I always use the online available Ruby & RoR APIs, while having them offline would give me faster loading times and doesn’t require an internet connection (although that situation is probably the same as being cut off from water for most of us 🙂 ).
There is a project page on sourceforge that contains CHM documentation for Ruby 1.8.6 and Rails 2.3.
Do it yourself
Rdoc provides you with four possible formats to create your own documentation: html, xml, ri and chm.
To create the documentation for Ruby, go to the Ruby source directory (\src\ruby-x.x.x-pxxx) in the console and enter:
rdoc -f [format] -o [destination-folder].
To create the documentation for Rails, go to the ruby gems directory (i.e. \lib\ruby\gems\1.8\gems) and enter:
rdoc -f [format] -x test/* -x template/* -o [destination-folder] action* active* rails-* .
The extra argument
-x template/* is needed here to prevent errors from occurring during compilation, as discussed here. This problem occurs for both html and chm compilation.
Update 16-12-2008: When generating the Rails documentation, a good idea is to also add
-x test/* to the command, since you’ll probably don’t need the documentation of Rails’s test classes, which are included in the gems.
If you are using windows, you might like the CHM format (the Windows Helpfile format). To be able to create CHM files, you’ll need HTML Help Workshop. Install it in C:\Program Files\HTML Help Workshop\, even if you are running Windows x64.
Update 16-12-2008: A small list of locations of gem home directories:
- Mac OS X
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/user-gems/1.8/gems (included version)