Tailor configuration values to match your development process with ease.
For example, maybe you use different URLs for your app in each environment. With Catalyst::Plugin::Mode, you can manage this process in the configuration only, without any calling methods. All you need to do is describe some options in your config using a .yml file or in Perl.
Here's an example config in .yml:
Catalyst::Plugin::Mode:
keys:
- any
- another
mode: test
any:
dev:
one_url: ''
two_url: ''
test:
one_url: ''
two_url: ''
prod:
one_url: ''
two_url: ''
another:
dev:
one_url: ''
two_url: ''
test:
one_url: ''
two_url: ''
prod:
one_url: ''
two_url: ''
Or, you can set it up in Perl:
__YOUR_APPLICATION__->config({
'Catalyst::Plugin::Mode' => {
keys => [qw/any any.else any.any.another/],
mode => 'test'
},
any => {
dev => {
one_url => '',
two_url => ''
},
test => {
one_url => '',
two_url => ''
},
prod => {
one_url => '',
two_url => ''
},
another => {
dev => {
one_url => '',
two_url => ''
},
test => {
one_url => '',
two_url => ''
},
prod => {
one_url => '',
two_url => ''
},
},
},
});
Once your Catalyst app is up and running, this setup will parse the config, and everything will be ready to go. You can change only one value in your config - the mode - and all URLs will be as you need them to be.
One thing to note is that you can define valid values for the mode for your application to ENV{APPLICATION_MODE}. All examples in the tests, so you can rest assured that this plugin is well-tested and reliable.
Version 0.03: N/A