line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Component::Component::Plaggerize::PluginLoader; |
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
230
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub setup_config { |
6
|
1
|
|
|
1
|
0
|
4
|
my $class = shift; |
7
|
1
|
|
|
|
|
7
|
my $config = $class->NEXT( setup_config => @_ ); |
8
|
|
|
|
|
|
|
|
9
|
1
|
50
|
|
|
|
176
|
$config->{global} = {} unless $config->{global}; |
10
|
1
|
50
|
|
|
|
9
|
$config->{global}->{pluginloader} = {} unless $config->{global}->{pluginloader}; |
11
|
1
|
|
|
|
|
3
|
my $conf = $config->{global}->{pluginloader}; |
12
|
1
|
|
50
|
|
|
8
|
$conf->{plugin_list} ||= 'plugins'; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
15
|
$config; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub setup_plugins { |
18
|
1
|
|
|
1
|
0
|
4
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
2
|
my @plugins; |
21
|
1
|
|
|
|
|
4
|
my $plugin_list = $self->conf->{global}->{pluginloader}->{plugin_list}; |
22
|
1
|
|
|
|
|
2
|
for my $plugin (@{ $self->conf->{$plugin_list} }) { |
|
1
|
|
|
|
|
5
|
|
23
|
3
|
|
|
|
|
13
|
push @plugins, { module => $plugin->{module}, config => $plugin }; |
24
|
|
|
|
|
|
|
} |
25
|
1
|
|
|
|
|
6
|
$self->load_plugins(@plugins); |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
13
|
$self->NEXT( setup_plugins => @_ ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |