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.
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.
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:
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:
I added Mollom comment spam suppresion to Feather the other day. It is actually in place right here on this blog. Truthfully, you can't see it from the outside, but you'll have to take my word for it. Or go get a Feather install of your own and add the plugin by going to Plugins -> Install Plugin -> "http://notch8.com/feather-mollom", plugin your Mollom keys and off you go =-)
All the plugin does right now is ask Mollom's servers if a comment is spam. If it is the comment is saved, but not posted. If it is not spam then it is posted directly. There is more technology that Mollom offers, but if you want that then grab a fork on Github and get to work!
It is common to have others code lurking in the vendor directory of your project. Many have switched to using piston on the Subversion side of life, and braids fills the same gap over on the git side, but can be used to freeze either subversion or git repos.
Braids (like much of git) is still a little wet behind the ears in the usability department, so don't expect it to hold your hand through the process just yet. An example from today, I got the this message:
2008-03-28 12:26 $ braid add http://async-observer.rubyforge.org/svn/async_observer --type svn vendor/plugins/async_observer
braid: Creating work branch 'braid/track'
braid: Checking out work branch 'braid/track'.
braid: Adding svn mirror from 'http://async-observer.rubyforge.org/svn/async_observer' into 'vendor/plugins/async_observer' using local branch 'braid/svn/vendor/plugins/async-observer'.
braid: Got remote svn revision: 19.
braid: Setting up remote branch and fetching data.
braid: Error occured:
braid: Resetting braid/track to d38137af1951a32f0d217a2c77f3d553890576ba.
braid: Checking out branch 'async'.
braid: An exception has occured: ()
Its those empty parentheses that are really informative ;-) It turned out that I installed git via Macports, then manually installed a newer version in /usr/local/bin. I then had changed my path to have /opt/local/bin behind /usr/local/bin. That worked just fine until last week when some other (not SCM) thing broke and I switched them back (forgetting why I'd switched in the first place). The bottom line is the error above is caused by not having subversion bindings installed right in git. Macports now has a better version to use, so I blew away the custom compiled one and just updated my Macports to be right. I found the comment about subversion bindings at the bottom of this excellent post
I like to tweak my workflow all the time. I often change something for a week, try it out and then either change back or move on to something else. I got used to tabbed terminals in Linux and even had mrxvt working under cygwin, so when I came to the Mac not having tabs in the Terminal bugged me. I tried several solutions and settled on iTerm. Life was good for a while. I got tired of using nohup to run long emerges in the background on the servers, so I learned about gnu screen. That led me to wonder if you could get labels for the various windows, and sure enough the hardstatus line will happily act as a tab bar for you as long as your not fond of clicking to change tabs (in the terminal? You shouldn't be). I had seen Visor and thought it was cool, so I tried it out for a while with Screen to give me tabs. There where some problems with Visor interacting weird with screen, so back to iTerm I went. When I updated to Leopard, I moved to Terminal.app, since it had tabs now. But it turns out I had grown to love the "Do what I'm typing in all tabs" feature. So I went back yet again. But iTerm didn't work as well for me under Leopard as it did under Tiger. So I got over not having the do in all tabs feature and lived with Terminal.app. Recently I realized that I was spending a lot of time 'setting up' my work environment. The steps go like this:
Go to tab 1
Stop script server
Change directory to new project
Restart script/server
Go to tab 2
Stop autotest
Change directory to new project
Start autotest
Go to tab 3
Change directory to new project
Run sake gitrdone
does svn up or git pull (depending on .git file)
does rake db:migrate
rake db:test:clone
rake spec:db:fixtures:load
rake notes
svn status | grep ? or git status
mate .
So yeah, thats a lot. Way to much to do manually (even with the awesome sake script). So I started looking around the web to see what others had done. I found this OnRails article which seems to have met with some serious frustration, and the associated links. The outlook did not look good. So back to iTerm... again. That still wasn't satisfying. Then I stumbled across something (I don't remember what) that mentioned screens -X and its -X stuff command. The way it works is this. -X tells screen to do one of its internal commands from the outside, so screen -X next would change the focused window by one, either form inside the screen session or from outside of it. stuff 'do this' is the screen command that sends 'do this' to the current screen. That got me thinking... what if screen could be used to do all the magic that Apples sucky Applescript in Terminal.app can't? So I started to fiddle and hack and read. Screen's documentation is the suck, though I did find this source This led to the creation of the following script
I drop that into my bin dir under the title hack and now as long as screen is running I can do
hack ~/work/project/trunk
and off I go. It is worth noting that since it sends a kill to whatever is running in the first and second screen tabs, you have to run it from either outside screen or from some tab other than the first or second.
I also found this article that showed my some other features of scripting screen and allowed me to write a script I call all which takes whatever you type after it and sends it to all open tabs in a screen session.
I've coupled this with my .screenrc file and the new version of Visor lets me have simple drop down terminal with all the power I need.
Well... almost ;-) I've been using the Google Talk in iChat or Adium (and then back to iChat) for some time now. Back in August I read this Lifehacker article and implemented it. I'm a total clepto when it comes to chat logs... I keep everything I can usually. When your done you have the ability to route all of your various IM accounts (AIM, Yahoo, MSN, Jabber) through one Google Talk account. I have my AIM and Yahoo buddies actually on again now. And whats really cool to me is all the logging takes place in gMail, so when I think: "what did SoAndSo say about the bananas again?" I just search for SoAndSo and bananas in gMail and I never have to think about whether it was an email conversation or a chat one. It makes me happy =-) Also there are lots of other cool Jabber services out there that this can be used with, so that is cool. I tried doing IRC over jabber for a while, which worked, but doesn't have enough features for me once it goes through the limitations of the gTalk service (notice these are gTalk limits, not Jabber limits).
There are two major caveats to this approach. The first is that you can't do direct connect, file transfer, voice or video with folk on other networks this way. The other is Skype doesn't have any transports (to anything, the bastards). Given that iChat does pretty good audio, video and now desktop sharing and that most of my Skype people are also on either gTalk or AIM, you may be seeing me less and less on Skype.
I generally love this comic by John Zakour and Kyle Miller, and when I saw the one from Halloween I just knew it couldn't be too hard for Anna to replace the y in Roy with a b. If anyone is upset about me putting this up (I make no claim that this work is mine) feel free to email me and I'll take it down. In the mean time I hope it gives you as good a chuckle as it gave me. And thanks go to Anna for the Photoshop job.