set environment in command line
http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod#Configuration_and... "Note that you can change the running environment using the --environment commandline switch." #!/usr/bin/env perl # [...] use Dancer ':script'; use Data::Dumper; say Dumper(config); die; # end of test script # ./test.pl --environment dev2 | grep env Died at ./test.pl line 32. 'envdir' => '/home/.../environments', 'environment' => 'development', Is it ok? Am I doing something wrong? -- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130
ok, config->{environment}='dev2'; Dancer::Config::load(); now # ./test.pl --environment dev2 | grep env ErrorConnectServer at ./test.pl line 139. # my custom error 'envdir' => '/home/.../environments', 'environment' => 'dev2', On `say Dumper(config)` I see that environment (including data for D::P::DataBase) is not loaded. So, how should I set up 'dev' environment for ':script' scripts? 01.05.2012 15:38, Nick Knutov написал:
http://search.cpan.org/dist/Dancer/lib/Dancer/Cookbook.pod#Configuration_and...
"Note that you can change the running environment using the --environment commandline switch."
#!/usr/bin/env perl # [...] use Dancer ':script'; use Data::Dumper; say Dumper(config); die; # end of test script
# ./test.pl --environment dev2 | grep env Died at ./test.pl line 32. 'envdir' => '/home/.../environments', 'environment' => 'development',
Is it ok? Am I doing something wrong?
-- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130
sorry, this part is not actual, I had wrong configs. 01.05.2012 16:14, Nick Knutov написал:
ok,
config->{environment}='dev2'; Dancer::Config::load();
now
# ./test.pl --environment dev2 | grep env ErrorConnectServer at ./test.pl line 139. # my custom error 'envdir' => '/home/.../environments', 'environment' => 'dev2',
On `say Dumper(config)` I see that environment (including data for D::P::DataBase) is not loaded.
-- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130
participants (1)
-
Nick Knutov