App::genconf - The world's simplest config file generator
# Create a config template vi templates/config/myapp_local.yml app_name: [% APP_NAME %] is_production: [% IS_PRODUCTION %] # Add the required rontment variables export APP_NAME=LOLCatter export IS_PRODUCTION=0 # Run genconfig genconfig templates/config
Genconf is a very simple config file generation tool. Source control config templates; use a simple command to genrate|update whatever environment's config files.
# Make config values required by using the assert plugin, which causes the # template processor to throw an error if undef values are returned: [% USE assert %] app_name: [% env.assert.APP_NAME %] # Cut out optional config sections with a simple IF: [% IF DB_CONN_STRING and DB_USERNAME and DB_PASSWORD %] db_connection_info: - [% DB_CONN_STRING %] - [% DB_USERNAME %] - [% DB_PASSWORD %] [% END %] # Use the TAGS directive if you need [% in your config: [% TAGS [- -] %] [%User] name = [- USER_NAME -] password = [- USER_PASSWORD -]
How it helps:
Store all configs in version control
Never commit passwords to version control
Keep team members' dev config schemas in sync
Specify the config file output directory
To install App::genconf, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::genconf
CPAN shell
perl -MCPAN -e shell install App::genconf
For more information on module installation, please visit the detailed CPAN module installation guide.