GemBrain - RailsBrain for Everything

Posted by Rob Kaufman
on Jun 15, 08

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:

  1. Download the tar.gz file from GitHub
  2. Untar and copy the files to your rdoc install (follow README)
  3. 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
  4. 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

  1. Go to System Preferences -> Sharing and turn on Web Sharing and then click on the link for your personal site (not the computers site)
  2. 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.

Awesome Lecture

Posted by Rob Kaufman
on Jun 12, 08

See I'm not the only one on the video game - programmer link... I wonder if I could get a grant to add pair programming training to Alice?

Kdiff3 + Git = Win

Posted by Rob Kaufman
on Jun 06, 08

On OS X the default merge tool is opendiff... which I have never liked. So I don't use it. Instead, I use the vastly more powerful kdiff3. Yes that 'k' you see in the front indecates a KDE program, but it is in pure qt (no KDE dependancies) and there is a really nice DMG based OS X package. And it is really powerful!

Git's mergetool had the option to use KDiff3, but of course if your KDiff3 is installed in /Applications/kdiff3.app/Content/MacOS/kdiff3, Git doesn't know where to find it. There are two possible solutions to this. The first is to add kdiff3 to your path. The second is to explicitly tell Git where to find it. I executed the following:

git config --global mergetool.kdiff3.path /Applications/kdiff3.app/Contents/MacOS/kdiff3
git config --global mergetool.tool kdiff3

Which globally (for all git projects on my user) sets the path to KDiff3 and then sets KDiff3 to the default for the mergetool command. There is one other little quirk needed to make either the path based method or this method work. Open KDiff 3 and make the following change:

Click: KDiff3 -> Preferences -> Integration

Add: "; --"

Save the setting and exit kdiff3