RailsBrain is a pretty cool way to look at your Rails docs, but as always... I want more from my tools. I had the idea to extend it to all my Ruby gems when I saw this RubyInside, thinking that is what it was about. Of course it is not quite that grand. I won't say I looked at all the options, because there are too many and they are too quiet. I have looked at a lot of them though. If I could have anything I would have CHM files that I can create on Linux and OS X (no Wine doesn't count). Those things are pretty dang cool. But alas at the moment it is not to be. I do have some ideas about that, but I'll drop those another time. So what I'm doing right now is I added ALL of my Rubygems into one RailsBrain instance. This includes Merb, Rails and everything else. And now I'm going to show all of you how to do the same.
Steps:
- Download the tar.gz file from GitHub
- Untar and copy the files to your rdoc install (follow README)
- You want to clean up your gems so you don't have too many duplicates... be careful here if you intentionally have multiple versions of the same package sudo gem clean
- Run the following command, replacing PATH_TO_RUBY with your Ruby installs path (in my case /opt/local/lib/ruby) rdoc --fmt ajax PATH_TO_RUBY/gems/1.8/gems//lib/* --op ~/Sites/docs
You need some sort of web server to server the documents... the rest of these instructions are Mac OS X specific
- Go to System Preferences -> Sharing and turn on Web Sharing and then click on the link for your personal site (not the computers site)
- That should open in the browser, now add /docs to the end (mine looks like http://pumpkin.local/~rob/docs)
Enjoy! Remember you can rerun the builder any time you want to refresh your docs... but you do need to move the old version out of the way first.