line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::ZConfig; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
87
|
use strictures 1; |
|
15
|
|
|
|
|
83
|
|
|
15
|
|
|
|
|
482
|
|
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
|
225
|
|
|
225
|
0
|
404
|
my ($class, $args) = @_; |
17
|
225
|
100
|
66
|
|
|
657
|
return $ALL_DEFAULT if $ALL_DEFAULT && !keys %{$args||{}}; |
|
212
|
100
|
|
|
|
2280
|
|
18
|
13
|
|
|
|
|
48
|
my $new = {}; |
19
|
13
|
|
|
|
|
80
|
foreach my $arg_name (keys %DEFAULTS) { |
20
|
65
|
|
33
|
|
|
609
|
$new->{$arg_name} = $args->{$arg_name} || $DEFAULTS{$arg_name}; |
21
|
65
|
50
|
|
|
|
254
|
if (ref($new->{$arg_name})) { |
22
|
0
|
|
|
|
|
0
|
$new->{$arg_name} = $new->{$arg_name}->with_zconfig($new); |
23
|
|
|
|
|
|
|
} else { |
24
|
65
|
|
|
|
|
97
|
require(do { (my $m = $new->{$arg_name}) =~ s/::/\//g; "${m}.pm" }); |
|
65
|
|
|
|
|
410
|
|
|
65
|
|
|
|
|
49918
|
|
25
|
65
|
|
|
|
|
1015
|
$new->{$arg_name} = $new->{$arg_name}->new({ zconfig => $new }); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
13
|
50
|
|
|
|
45
|
$ALL_DEFAULT = $new if !keys %{$args||{}}; |
|
13
|
50
|
|
|
|
101
|
|
29
|
13
|
|
|
|
|
97
|
bless($new, $class); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
170
|
|
|
170
|
0
|
802
|
sub parser { shift->{parser} } |
33
|
56
|
|
|
56
|
0
|
260
|
sub producer { shift->{producer} } |
34
|
143
|
|
|
143
|
0
|
461
|
sub filter_builder { shift->{filter_builder} } |
35
|
120
|
|
|
120
|
0
|
637
|
sub selector_parser { shift->{selector_parser} } |
36
|
633
|
|
|
633
|
0
|
2620
|
sub stream_utils { shift->{stream_utils} } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |