Adam Flott > Thorium > Thorium::BuildConf

Download:
Thorium-0.510.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.510   Source  

NAME ^

Thorium::BuildConf - Configuration management class

VERSION ^

version 0.510

SYNOPSIS ^

This class should be extended and customized to your application.

    package Some::App::BuildConf;

    use Thorium::Protection;

    use Moose;

    extends 'Thorium::BuildConf';

    use Thorium::BuildConf::Knob::URL::HTTP;

    has '+files' => ('default' => 'config.tt2');

    has '+knobs' => (
        'default' => sub {
            [
                Some::App::BuildConf::Knob::URL::HTTP->new(
                    'conf_key_name' => 'some_app.',
                    'name'          => 'favorite web site',
                    'question'      => 'What is your favorite web site?'
                )
            ];
        }
    );

    __PACKAGE__->meta->make_immutable;
    no Moose;

And driven by a configure script

    #!/usr/bin/env perl

    use strict;

    use Some::App::BuildConf;

    Some::App::BuildConf->new(
        'conf_type' => 'Some::App::Conf',
    )->run;

DESCRIPTION ^

Thorium::BuildConf consists of two main parts. The configuration console GUI and the file generator.

The configuration console GUI provides a way someone unfamiliar with your application to alter the defaults. They may save a version into their own preset or use a fixup.

FEATURES ^

CONFIGURATION CONSOLE GUI

Thorium::BuildConf uses Hobocamp (bindings for dialog(1)) and it's widget set for an interactive console user interface.

FILE GENERATION

You should use

KNOBS

A knob is anything that is tunable with strict or loose input validation. See Thorium::BuildConf::Knob for creating your own custom knob.

PRESETS

A preset is a static YAML data specific to a user or an environment. These are generally found in the directory 'conf/presets' under your application root. However these files can be in any location under your application root by changing preset_path default in your subclass, such as:

  has '+preset_path' => ('default' => sub { [ 'perl', 'conf', 'presets' ] } );

ATTRIBUTES ^

Required Attributes

Optional Attributes

PUBLIC API METHODS ^

AUTHOR ^

Adam Flott <adam@npjh.com>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2011 by Adam Flott <adam@npjh.com>, CIDC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: