PerlDancer/Dancer2 — pull request #575 by veryrusty (2014-04-25 14:32:11+00:00)
Title: Clean up multiple apps mounted via Plack::Builder (i.e. make the cookbook example work!)

Rather than always building the dispatcher and psgi app coderef over all available apps, this Pr makes it possible to build a psgi app coderef over a subset of the apps. If you have more than one (independent) Dancer2 app what would otherwise has a "clashing" route, this allows them to be combined into a single app (via Plack::Builder) and have the requests dispatched to the appropriate app (rather than first one wins).

Adds a `psgi_app` DSL keyword, to simplify getting the psgi app for a *single* namespace, eg. `MyApp->psgi_app`.

Also fixes an issue in the dispatcher, in which if no route was matched then apps were left with a context attribute ( which may be later incorrectly used for the check if a dsl keyword is used in a route definition )