This is essentially what Zed Shaw was working on for Python:
https://github.com/zedshaw/fuqit (https://news.ycombinator.com/item?id=6039146) and here's another for Node https://github.com/ricardobeat/fuqit
I'd love something like this fully fleshed out for Ruby. Some things PHP did "get right" like how it "just works."