Sébastien Aperghis-Tramoni > RackMan > RackMan::Format::Generic

Download:
RackMan-1.18.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source  

NAME ^

RackMan::Format::Generic - Generate a file from a generic for a given RackObject

SYNOPSIS ^

on the command line:

    rack write -G Generic -t input.tmpl -o %name%.conf device-name

in code:

    use RackMan::Format::Generic;

    $rackman->options->{template} = "path/to/input.tmpl";
    $rackman->options->{output}   = "path/to/%name%.conf";

    RackMan::Format::Generic->write({
        rackdev => $rackdev,  # a RackMan::Device instance
        rackman => $rackman,  # a RackMan instance
    });

DESCRIPTION ^

This module is a generic file generator: it takes a template file as input, processes it and write the result on disk if a path was provided, otherwise on screen. As shown in the synopsis, this allows to use rack(1) as a simple generic templating processor.

METHODS ^

write

Generate the file.

Arguments

Arguments are expected as a hashref with the following keys:

TEMPLATE PARAMETERS ^

See "TEMPLATE PARAMETERS" in RackMan::Template for more details about the available parameters.

CONFIGURATION ^

This module gets its configuration from the [format:dhcp] section of the main rack.conf, with the following parameters:

SEE ALSO ^

RackMan::Template

AUTHOR ^

Sebastien Aperghis-Tramoni

syntax highlighting: