Hey guys,

Carl and I spent a couple of day refactoring the code in bin/rackup into Rack::Server. The main motivation for this was to enable Rails to ditch our code in script/server and simply inherit from the requisite Rack code. I think the code improvement speaks for itself. In the process of this work, we also moved a few things out of Rackup into more usable locations, like Rack::Handler.default (to get the handler that Rack will use if none is specified) and Rack::Builder.parse_file (which we currently duplicate in ActionDispatch).

You can check out the changes at github.com/carllerche/rack, and I have also attached a patch. In addition to converting the rackup binary to a class, we also wrote tests for each function of rackup, to be sure we wouldn't break anything in the refactor. As a result, this patch now has tests for rackup!

Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325