line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::ZConfig; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
67
|
use strictures 1; |
|
15
|
|
|
|
|
69
|
|
|
15
|
|
|
|
|
317
|
|
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
|
251
|
|
|
251
|
0
|
302
|
my ($class, $args) = @_; |
17
|
251
|
100
|
66
|
|
|
553
|
return $ALL_DEFAULT if $ALL_DEFAULT && !keys %{$args||{}}; |
|
238
|
100
|
|
|
|
1703
|
|
18
|
13
|
|
|
|
|
30
|
my $new = {}; |
19
|
13
|
|
|
|
|
73
|
foreach my $arg_name (keys %DEFAULTS) { |
20
|
65
|
|
33
|
|
|
387
|
$new->{$arg_name} = $args->{$arg_name} || $DEFAULTS{$arg_name}; |
21
|
65
|
50
|
|
|
|
164
|
if (ref($new->{$arg_name})) { |
22
|
0
|
|
|
|
|
0
|
$new->{$arg_name} = $new->{$arg_name}->with_zconfig($new); |
23
|
|
|
|
|
|
|
} else { |
24
|
65
|
|
|
|
|
68
|
require(do { (my $m = $new->{$arg_name}) =~ s/::/\//g; "${m}.pm" }); |
|
65
|
|
|
|
|
351
|
|
|
65
|
|
|
|
|
29674
|
|
25
|
65
|
|
|
|
|
790
|
$new->{$arg_name} = $new->{$arg_name}->new({ zconfig => $new }); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
13
|
50
|
|
|
|
33
|
$ALL_DEFAULT = $new if !keys %{$args||{}}; |
|
13
|
50
|
|
|
|
136
|
|
29
|
13
|
|
|
|
|
84
|
bless($new, $class); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
190
|
|
|
190
|
0
|
685
|
sub parser { shift->{parser} } |
33
|
60
|
|
|
60
|
0
|
189
|
sub producer { shift->{producer} } |
34
|
157
|
|
|
157
|
0
|
342
|
sub filter_builder { shift->{filter_builder} } |
35
|
130
|
|
|
130
|
0
|
416
|
sub selector_parser { shift->{selector_parser} } |
36
|
665
|
|
|
665
|
0
|
1702
|
sub stream_utils { shift->{stream_utils} } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |