Wrote my first bit of Rack middleware yesterday for a Rails application. Not so hard to do once you know how it passes requests through.