PerlDancer/Dancer2 — pull request #693 by DavsX (2014-09-19 10:01:44+00:00)
Title: Feature/handler file config option

This PR does a couple of thing (I wanted to separate those into their own PR, but they kinda depend on each other)

* The 'public' config option is added to D2::Core::App's default_config inside _build_default_config. It's value is $ENV{DANCER_PUBLIC} || path($app->location, 'public'). When the public dir is specified in the config, this value will be overwritten in the resulting merged $app->config.
The duplicated logic of building the public dir location is removed from D2::Handler::File and D2::Core::Error; they both use $app->config->{public} now.

* public_dir is removed from the File route handlers default config inside the same _build_default_config method. There is already a Dancer2-global 'public' config option, so why to duplicate, we can simply use that.

* the route_handlers config is changed. Instead of an arrayref, it is now a hashref, like this:
```yaml
route_handlers:
File: 1
AutoPage: 0
```
This way individual route handlers can be explicitly enabled/disabled, you no longer need to set 'route_handlers: []' to disable the File handler, you can now set it's value explicitly to 0.

* For now, I added deprecation warning for the old route_handlers config use. If it's value is an old-style arrayref, it is parsed into the new format, so it is working, but it now issues a warning, that it is deprecated.

* I deprecated the auto_page config option as well. There were two config options to enable/disable this feature; AutoPage => 1 inside route_handlers and auto_page itself. The old behavior was like this: the AutoPage handler was created and added to the app's route_handlers array, because the AutoPage config value inside _build_default_config was 0. But inside Handler::AutoPage->register the auto_page option was used to determine if we need to add any routes.
Now there is only one config option for it; if it is 0, the handler is not even created.

* I updated Dancer2::Config and Dancer2::Cookbook according to these changes.