line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Pods2Site::SiteBuilderFactory; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
51
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
459
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.003'; |
7
|
|
|
|
|
|
|
my $version = $VERSION; |
8
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
require App::Pods2Site::SiteBuilder::None; |
11
|
|
|
|
|
|
|
require App::Pods2Site::SiteBuilder::BasicFramesSimpleTOC; |
12
|
|
|
|
|
|
|
require App::Pods2Site::SiteBuilder::BasicFramesTreeTOC; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $STDSTYLE = 'basicframes-tree-toc'; |
15
|
|
|
|
|
|
|
my %VALIDSTYLES = |
16
|
|
|
|
|
|
|
( |
17
|
|
|
|
|
|
|
'none' => 'App::Pods2Site::SiteBuilder::None', |
18
|
|
|
|
|
|
|
'basicframes-simple-toc' => 'App::Pods2Site::SiteBuilder::BasicFramesSimpleTOC', |
19
|
|
|
|
|
|
|
'basicframes-tree-toc' => 'App::Pods2Site::SiteBuilder::BasicFramesTreeTOC', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# CTOR |
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
sub new |
25
|
|
|
|
|
|
|
{ |
26
|
3
|
|
|
3
|
0
|
9
|
my $class = shift; |
27
|
3
|
|
50
|
|
|
29
|
my $style = shift || ':std'; |
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
|
|
56
|
my $self = bless( { style => $style }, $class ); |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
22
|
$self->__computeStyle($style); |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
|
|
51
|
return $self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub getStyle |
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
0
|
return $self->{style}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub getRealStyle |
44
|
|
|
|
|
|
|
{ |
45
|
6
|
|
|
6
|
0
|
12
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
6
|
|
|
|
|
43
|
return $self->{realstyle}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub createSiteBuilder |
51
|
|
|
|
|
|
|
{ |
52
|
3
|
|
|
3
|
0
|
5
|
my $self = shift; |
53
|
|
|
|
|
|
|
|
54
|
3
|
|
|
|
|
6
|
$self->{sitebuilderclass}->new($self->getRealStyle()); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# PRIVATE |
58
|
|
|
|
|
|
|
# |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub __computeStyle |
61
|
|
|
|
|
|
|
{ |
62
|
3
|
|
|
3
|
|
9
|
my $self = shift; |
63
|
3
|
|
|
|
|
5
|
my $style = shift; |
64
|
|
|
|
|
|
|
|
65
|
3
|
50
|
|
|
|
10
|
$style = $STDSTYLE if $style eq ':std'; |
66
|
3
|
|
|
|
|
21
|
$self->{realstyle} = $style; |
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
|
|
42
|
my $siteBuilderClass = $VALIDSTYLES{$style}; |
69
|
3
|
50
|
|
|
|
12
|
die("No such style: '$style' (available: " . join(',', keys(%VALIDSTYLES)) . ")\n") unless $siteBuilderClass; |
70
|
3
|
|
|
|
|
9
|
$self->{sitebuilderclass} = $siteBuilderClass; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |