Path of Gmail Notifr
I started Gmail Notifr in Oct 2008 to learn RubyCocoa and OS X Cocoa programming. From day one, I myself was an end user. I felt more productive when I was able to receive new gmail notifications at a longer interval - I don’t need instance disturbing - that was the most important feature I wanted to build.
After a couple of long nights, I released v0.6.0 (Lion test build) and v0.6.1 (Lion compatible). It has been 11 months since the last release (v0.5.2)! Although no version has ever been released since 0.5.2, I’ve been refactoring the codebase actively. Not surprisingly, 0.6+ is a toy written in MacRuby, which needs no introduction.
v0.6.1 doesn’t seem to run on Snow Leopard (oops, it’s my bad). I have three Macs all having Lion installed. Need to get a Snow Leopard machine to work on the issue(it’s Security.framework and BridgeSupport related).
Gmail Notifr has a simple path, it was originally written in RubyCocoa - at that time RubyCocoa seemed to be the best Cocoa framework for rubyists. Now it’s totally in MacRuby. I don’t plan to write it in Objective-C though, I could write as much Objective-C on iOS development <3
The core of Gmail Notifr is very simple: it checks the gmail atom, then displays the result on menubar and through Growl.
So when it’s time to check (either triggered by user, or the configured interval reaches), a background job starts. Along the path, I implemented the background job in three ways:
- The initial was an NSTask. It ran a subprocess (the actual checker) and monitored the execution.
- Then NSOperation. So each checker was queued and executed.
- Now Disptach::Queue (Grand Central Dispatch a.k.a GCD). Checkers run concurrently, results pushed to main thread queue. Simple yet works great.
I don’t think I have to add more features to this toy, but enchancing the codebase and learning new things is so fun I would like to keep it live.