File Coverage

blib/lib/ASP4/ConfigParser.pm
Criterion Covered Total %
statement 15 18 83.3
branch 0 2 0.0
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 20 27 74.0


line stmt bran cond sub pod time code
1              
2             package ASP4::ConfigParser;
3              
4 9     9   31 use strict;
  9         11  
  9         237  
5 9     9   44 use warnings 'all';
  9         12  
  9         243  
6 9     9   2781 use ASP4::Config;
  9         20  
  9         1592  
7              
8              
9             sub new
10             {
11 9     9 0 29 my ($class) = @_;
12            
13 9         69 return bless { }, $class;
14             }# end new()
15              
16              
17             sub parse
18             {
19 9     9 0 20 my ($s, $doc, $root) = @_;
20            
21 9         87 my $config = ASP4::Config->new( $doc, $root );
22            
23             # Now do any post-processing:
24 9         113 foreach my $class ( $config->system->post_processors )
25             {
26 0         0 (my $file = "$class.pm") =~ s/::/\//;
27 0 0       0 require $file unless $INC{$file};
28 0         0 $config = $class->new()->post_process( $config );
29             }# end foreach()
30            
31 9         345 return $config;
32             }# end parse()
33              
34             1;# return true:
35