View on
MetaCPAN
Matt Finkel > App-genconf-0.006 > App::genconf

Download:
App-genconf-0.006.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.006   Source  

NAME ^

App::genconf - The world's simplest config file generator

SYNOPSIS ^

  # 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

DESCRIPTION ^

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.

TEMPLATE TIPS ^

  # 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:

ARGUMENTS ^

--config-dir

Specify the config file output directory

syntax highlighting: