Catalyst::Plugin::ModeSelect config values depends in your development process | |
Download |
Catalyst::Plugin::Mode Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- PLCGI
- Publisher web site:
- http://search.cpan.org/~plcgi/
Catalyst::Plugin::Mode Tags
Catalyst::Plugin::Mode Description
Select config values depends in your development process Catalyst::Plugin::Mode is a Perl module to select config values depends in your development process.Only include the plugin in your main app module Sometimes you need any values for your environment(development,test,predproduction,production)For example in development you use such urls as http://you_urlin test http://test_domain.you_url/pathin production http://prod_domain.you_url/blablaYou can manage this process with the plugin - in configuration only, without any calling methods describe some options in your config such wayin .yml Catalyst::Plugin::Mode: keys: - any - another mode: test any: dev: one_url: http://dev_one_url two_url: http://dev_two_url test: one_url: http://test_one_url two_url: http://test_two_url prod: one_url: http://prod_one_url two_url: http://prod_two_url another: dev: one_url: http://any_another_dev_one_url two_url: http://any_another_dev_two_url test: one_url: http://any_another_test_one_url two_url: http://any_another_test_two_url prod: one_url: http://any_another_prod_one_url two_url: http://any_another_prod_two_urlin perl __YOUR_APPLICATION__->config({ 'Catalyst::Plugin::Mode' => { keys => , mode => 'test' }, any => { dev => { one_url => 'http://dev_one_url', two_url => 'http://dev_two_url' }, test => { one_url => 'http://test_one_url', two_url => 'http://test_two_url' } prod => { one_url => 'http://prod_one_url', two_url => 'http://prod_two_url' }, another => { dev => { one_url => 'http://any_another_dev_one_url', two_url => 'http://any_another_dev_two_url' }, test => { one_url => 'http://any_another_test_one_url', two_url => 'http://any_another_test_two_url' } prod => { one_url => 'http://any_another_prod_one_url', two_url => 'http://any_another_prod_two_url' }, } });When you run your catalyst app, setup parse config and will be any => { one_url => 'http://test_one_url', two_url => 'http://test_two_url' another => { one_url => 'http://any_another_test_one_url', two_url => 'http://any_another_test_two_url' }In such way you can change only one value in your config - mode and all urls will be as you need You can define valid valuev for mode for your application to ENV{APPLICATION_MODE} All examples in tests Requirements: · Perl
Catalyst::Plugin::Mode Related Software