sinatra/sinatra — pull request #486 by mjijackson (2012-03-14 23:50:48+00:00)
Title: More narrow definition of Sinatra::Base#build

Instead of taking a Rack::Builder as an argument, it would be a cleaner
separation of responsibilities to make Sinatra::Base#build take any app
as an argument and simply wrap it in the middleware pipeline.

My particular use case for this behavior is that I'd like to keep around
a reference to the original app in a test, but still be able to test the
app fronted by its middleware as well. Thus, I could call new! to get a
reference to the inner app, and then simply pass that reference through
build(app).to_app to get an instance of that app fronted by the
middleware.