Shoot, I swear I once heard of a self-published ebook that I thought was titled "reinventing rails" which was about a step-by-step reimplementation of a ruby-on-rails-like web framework to justify all the design decisions along the way. And now I totally cannot find it.
Whup! Found it. "rebuilding rails". The secret is, instead of going back to that one post tagged "ruby" from 2 years ago and browsing forward, day-by-day, browse backwards.