sukria/Dancer — Issue #674: Mistake in doc i think
Author: Perlover
Created: 2011-10-11 17:26:47+00:00
State: open

Good day!

After researching of sources i noticed strange lines:

1) To open perldoc Dancer::Deployment

2) Near "Running multiple apps with Plack::Builder" i see examples:

my $app1 = sub {
my $env = shift;
local $ENV{DANCER_APPDIR} = '/Users/franck/tmp/app1';
setting appdir => '/Users/franck/tmp/app1';
load_app "app1";
Dancer::App->set_running_app('app1');
Dancer::Config->load;
my $request = Dancer::Request->new( env => $env );
Dancer->dance($request);
};

I think the line:
setting appdir => '/Users/franck/tmp/app1';
Should be after line:
Dancer::App->set_running_app('app1');
Because setting sets appdir for global config (if there are no "applications")
After second running we will have "applications" and "setting appdir" will set appdir for previous run application (a pollution of other application's settings) and after "Dancer::App->set_running_app" we will have other application's namespace of settings and there will not appdir as "/Users/franck/tmp/app1"

How do you think?