File Coverage

blib/lib/Pod/Weaver/Config.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package Pod::Weaver::Config;
2             # ABSTRACT: stored configuration loader role
3             $Pod::Weaver::Config::VERSION = '4.017';
4 10     10   8216 use Moose::Role;
  10         26  
  10         135  
5              
6 10     10   66941 use Config::MVP 2;
  10         2123  
  10         358  
7 10     10   4665 use Pod::Weaver::Config::Assembler;
  10         39  
  10         449  
8              
9 10     10   96 use namespace::autoclean;
  10         26  
  10         109  
10              
11             #pod =head1 DESCRIPTION
12             #pod
13             #pod The config role provides some helpers for writing a configuration loader using
14             #pod the L<Config::MVP|Config::MVP> system to load and validate its configuration.
15             #pod
16             #pod =attr assembler
17             #pod
18             #pod The L<assembler> attribute must be a Config::MVP::Assembler, has a sensible
19             #pod default that will handle the standard needs of a config loader. Namely, it
20             #pod will be pre-loaded with a starting section for root configuration.
21             #pod
22             #pod =cut
23              
24             sub build_assembler {
25 1     1 0 52 my $assembler = Pod::Weaver::Config::Assembler->new;
26              
27 1         34 my $root = $assembler->section_class->new({
28             name => '_',
29             });
30              
31 1         2600 $assembler->sequence->add_section($root);
32              
33 1         332 return $assembler;
34             }
35              
36             1;
37              
38             __END__
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =head1 NAME
45              
46             Pod::Weaver::Config - stored configuration loader role
47              
48             =head1 VERSION
49              
50             version 4.017
51              
52             =head1 DESCRIPTION
53              
54             The config role provides some helpers for writing a configuration loader using
55             the L<Config::MVP|Config::MVP> system to load and validate its configuration.
56              
57             =head1 ATTRIBUTES
58              
59             =head2 assembler
60              
61             The L<assembler> attribute must be a Config::MVP::Assembler, has a sensible
62             default that will handle the standard needs of a config loader. Namely, it
63             will be pre-loaded with a starting section for root configuration.
64              
65             =head1 AUTHOR
66              
67             Ricardo SIGNES <rjbs@cpan.org>
68              
69             =head1 COPYRIGHT AND LICENSE
70              
71             This software is copyright (c) 2021 by Ricardo SIGNES.
72              
73             This is free software; you can redistribute it and/or modify it under
74             the same terms as the Perl 5 programming language system itself.
75              
76             =cut