| 1 | package Template::Flute::Config; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use Config::Any; | ||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Template::Flute::Config - Configuration file handling for Template::Flute | ||
| 11 | |||
| 12 | =head1 FUNCTIONS | ||
| 13 | |||
| 14 | =head2 load FILE | ||
| 15 | |||
| 16 | Loads configuration file FILE with L<Config::Any>. | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | sub load { | ||
| 21 | my ($file) = @_; | ||
| 22 | my ($cf_any, $cf_file, $cf_struct); | ||
| 23 | |||
| 24 | $cf_any = Config::Any->load_files({files => [$file], use_ext => 1}); | ||
| 25 | |||
| 26 | for (@$cf_any) { | ||
| 27 | ($cf_file, $cf_struct) = %$_; | ||
| 28 | } | ||
| 29 | |||
| 30 | return $cf_struct; | ||
| 31 | } | ||
| 32 | |||
| 33 | =head1 AUTHOR | ||
| 34 | |||
| 35 | Stefan Hornburg (Racke), <racke@linuxia.de> | ||
| 36 | |||
| 37 | =head1 LICENSE AND COPYRIGHT | ||
| 38 | |||
| 39 | Copyright 2010-2016 Stefan Hornburg (Racke) <racke@linuxia.de>. | ||
| 40 | |||
| 41 | This program is free software; you can redistribute it and/or modify it | ||
| 42 | under the terms of either: the GNU General Public License as published | ||
| 43 | by the Free Software Foundation; or the Artistic License. | ||
| 44 | |||
| 45 | See http://dev.perl.org/licenses/ for more information. | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | 1; |