line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Blosxom::Plugin::DataSection; |
2
|
3
|
|
|
3
|
|
3748
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
117
|
|
3
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
83
|
|
4
|
3
|
|
|
3
|
|
3328
|
use Data::Section::Simple; |
|
3
|
|
|
|
|
2207
|
|
|
3
|
|
|
|
|
1932
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my @exports = qw( get_data_section merge_data_section_into ); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub init { |
9
|
3
|
|
|
3
|
0
|
7
|
my ( $class, $caller ) = @_; |
10
|
3
|
|
|
|
|
30
|
$caller->add_attribute( data_section => \&_build_data_section ); |
11
|
3
|
|
|
|
|
8
|
$caller->add_method( $_ => \&{$_} ) for @exports; |
|
6
|
|
|
|
|
24
|
|
12
|
3
|
|
|
|
|
15
|
return; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _build_data_section { |
16
|
1
|
|
|
1
|
|
6
|
Data::Section::Simple->new($_[0])->get_data_section; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
1
|
6
|
sub get_data_section { $_[0]->data_section->{$_[1]} } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub merge_data_section_into { |
22
|
1
|
|
|
1
|
1
|
886
|
my ( $pkg, $merge_into ) = @_; |
23
|
1
|
|
|
|
|
3
|
my $data_section = $pkg->data_section; |
24
|
1
|
|
|
|
|
2
|
for my $name ( keys %{$data_section} ) { |
|
1
|
|
|
|
|
3
|
|
25
|
1
|
|
|
|
|
5
|
my ( $chunk, $flavour ) = $name =~ /(.*)\.([^.]*)/; |
26
|
1
|
|
|
|
|
6
|
$merge_into->{ $flavour }{ $chunk } = $data_section->{ $name }; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |