line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::ZConfig; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
91
|
use strictures 1; |
|
16
|
|
|
|
|
93
|
|
|
16
|
|
|
|
|
398
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
my %DEFAULTS = ( |
6
|
|
|
|
|
|
|
parser => 'HTML::Zoom::Parser::BuiltIn', |
7
|
|
|
|
|
|
|
producer => 'HTML::Zoom::Producer::BuiltIn', |
8
|
|
|
|
|
|
|
filter_builder => 'HTML::Zoom::FilterBuilder', |
9
|
|
|
|
|
|
|
selector_parser => 'HTML::Zoom::SelectorParser', |
10
|
|
|
|
|
|
|
stream_utils => 'HTML::Zoom::StreamUtils', |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $ALL_DEFAULT; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
252
|
|
|
252
|
0
|
408
|
my ($class, $args) = @_; |
17
|
252
|
100
|
66
|
|
|
695
|
return $ALL_DEFAULT if $ALL_DEFAULT && !keys %{$args||{}}; |
|
238
|
100
|
|
|
|
3505
|
|
18
|
14
|
|
|
|
|
43
|
my $new = {}; |
19
|
14
|
|
|
|
|
84
|
foreach my $arg_name (keys %DEFAULTS) { |
20
|
70
|
|
33
|
|
|
1124
|
$new->{$arg_name} = $args->{$arg_name} || $DEFAULTS{$arg_name}; |
21
|
70
|
50
|
|
|
|
241
|
if (ref($new->{$arg_name})) { |
22
|
0
|
|
|
|
|
0
|
$new->{$arg_name} = $new->{$arg_name}->with_zconfig($new); |
23
|
|
|
|
|
|
|
} else { |
24
|
70
|
|
|
|
|
95
|
require(do { (my $m = $new->{$arg_name}) =~ s/::/\//g; "${m}.pm" }); |
|
70
|
|
|
|
|
513
|
|
|
70
|
|
|
|
|
53567
|
|
25
|
70
|
|
|
|
|
1005
|
$new->{$arg_name} = $new->{$arg_name}->new({ zconfig => $new }); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
14
|
50
|
|
|
|
52
|
$ALL_DEFAULT = $new if !keys %{$args||{}}; |
|
14
|
50
|
|
|
|
132
|
|
29
|
14
|
|
|
|
|
112
|
bless($new, $class); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
191
|
|
|
191
|
0
|
881
|
sub parser { shift->{parser} } |
33
|
61
|
|
|
61
|
0
|
251
|
sub producer { shift->{producer} } |
34
|
157
|
|
|
157
|
0
|
483
|
sub filter_builder { shift->{filter_builder} } |
35
|
130
|
|
|
130
|
0
|
537
|
sub selector_parser { shift->{selector_parser} } |
36
|
667
|
|
|
667
|
0
|
2468
|
sub stream_utils { shift->{stream_utils} } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |