So 2012 is here, and I’ve run out of excuses to be terrible at cooking. So I purchased a book or two (the how to cook everything iPad app, and I’m looking at Cooking for Geeks) and went to town in the spices/baking aisles at Stop & Shop. Well, tonight, I made my first dinner, and it didn’t turn out quite as well as I would have liked. This is probably not what omelettes are supposed to look like. Good news is, there’s nowhere to go but up.
If you’d like to get together and cook with me sometime, let me know, as cooking is a lot more fun as a social thing, and I won’t have to eat all of my mistakes by myself.
I got into Rails in the late summer of 2006. It was a pretty wild ride: Rails 2.0 was still over a year away, Github didn’t exist, we were installing plugins (not gems) by finding them on technoweenie’s SVN repository, and best practices/libraries hadn’t really congealed yet. Everybody was more or less making their own way. This was somewhat restrictive, in the sense that we didn’t have the same communication tools, documentation resources, and software libraries we have today; but also extremely productive, as it forced the community to come up with creative solutions that would build on top of each other and create a best of breed. This is standard in any evolutionary process, and Node.js proves to be no exception.
Just as Rails was to me 5 years ago, Node.js is providing an exciting landscape.### but what am I doing with Node?
Well, I’m glad you asked. A friend of mine once taught me this Chess variation called Kriegspiel, where you can see your pieces but not those of your opponent’s. Through trial and error, you have to build an understanding of where your opponent’s pieces are, while they’re trying to do the same regarding your pieces. It’s a very challenging game, and I thought it’d be a great experiment for Node’s asynchronous nature. Also, my friend has been living overseas for the past few years, so it’s probably the only way we’d actually be able to play again. Enter Kriegspiel.js.
There are a few problems with the game right now… for one, you actually see both white and black pieces, and for another, it doesn’t actually work. But most of the pieces behave properly, and most of the captures work appropriately. Check, mate, en passant, and castling rules haven’t been implemented yet. But it’s coming along. And maybe one day you’ll be playing a game. Go ahead and try it out.
In the beginning, dhh taught us how to build a blog in 15 minutes. A few years ago, I was frustrated with the current toolset for creating a blog in Ruby on Rails, and so I decided to build a pluggable blogging system. That’s when I ran into some Rails 2 monkey-patching issues and never got off the ground. Rails 3, however, allows me to do some seriously cool stuff, and I’ve retooled my previous effort to create Governor. Named after everybody’s favorite governor, Rod Blagojevich.
Governor by itself is very bare: all it lets you do is post articles. Where it starts to get cool is when you start adding plugins. At the moment, there are 9 plugins to choose from, giving you the ability to add an ATOM feed, comments, tags, draft/published states, or even announce your article to twitter, as you post it. (That twitter plugin is built on top of a middle-tier governor_background plugin, which sends your post to twitter outside of your regular request cycle. It can sit on top of either delayed_job or resque.)
Governor will work with most authentication frameworks out of the box, including Devise, Authlogic, and Clearance. If you have different needs, just call rails generate governor:configure, and you can redefine how authentication and authorization will work for your app.
This is my first foray into framework development, so I’m learning a lot. (If you see any issues or anti-patterns, please let me know!) There are a few plugins and features I’d like to implement in the future: better URLs for articles, a better system for blog administration, better asset management, better forms markup, better i18n support, and testing add-ons that can be reused across plugins. But one of the nice things about a pluggable open-source is that, if this is a pain point for someone else, they can extend it. If you end up using this or building on top of this, or if you run up against an issue or would like a feature, please let me know.