- COPYRIGHT AND LICENSE
Templer::Global - Configuration-file parser for templer.
use strict; use warnings; use Templer::Global; my $site = Templer::Global->new( file => "./templer.cfg" ); my $suffix = $site->field( "suffix" );
This class is responsible for parsing the top-level templer.cfg file which we assume will be present in a templer-based site.
The file is a simple key=value store, with comments being prefixed by the hash ("#") character, and ignored.
This object is created when templer is started so that the options may be parsed/read. Once that happens the options are merged with the command-line flags, and this object isn't touched again.
This module is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or
b) the Perl "Artistic License".
Steve Kemp <email@example.com>
Copyright (C) 2012-2015 Steve Kemp <firstname.lastname@example.org>.
This library is free software. You can modify and or distribute it under the same terms as Perl itself.
Any parameters specified in our single hash-argument are saved away, the filename specified in the 'file' parameter will be opened and parsed.
Read the specified configuration file. Called by the constructor if a filename was specified.
Retrieve a value from the file, by key.
This is only called by templer to retrieve the pre/post-build commands to execute.
Retrieve all known key/value pairs.
This is called by templer to retrieve all global settings, which can then be merged with its defaults.