line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Pods2Site::AbstractSiteBuilder; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
46
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
88
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.003'; |
7
|
|
|
|
|
|
|
my $version = $VERSION; |
8
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
10
|
use App::Pods2Site::Util qw(slashify writeUTF8File); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
87
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
813
|
use File::Copy; |
|
2
|
|
|
|
|
4007
|
|
|
2
|
|
|
|
|
654
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# CTOR |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
sub new |
17
|
|
|
|
|
|
|
{ |
18
|
3
|
|
|
3
|
0
|
7
|
my $class = shift; |
19
|
3
|
|
|
|
|
6
|
my $styleName = shift; |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
14
|
my $self = bless( { stylename => $styleName }, $class ); |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
8
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub makeSite |
27
|
|
|
|
0
|
0
|
|
{ |
28
|
|
|
|
|
|
|
# do nothing |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub prepareCss |
32
|
|
|
|
|
|
|
{ |
33
|
3
|
|
|
3
|
0
|
8
|
my $self = shift; |
34
|
3
|
|
|
|
|
16
|
my $args = shift; |
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
|
|
12
|
my $sitedir = $args->getSiteDir(); |
37
|
|
|
|
|
|
|
|
38
|
3
|
|
|
|
|
37
|
my $sbName = $self->getStyleName(); |
39
|
3
|
|
|
|
|
51
|
my $sbCssContent = $self->_getCssContent(); |
40
|
|
|
|
|
|
|
|
41
|
3
|
50
|
|
|
|
16
|
if ($sbCssContent) |
42
|
|
|
|
|
|
|
{ |
43
|
3
|
|
|
|
|
17
|
my $sbCssFile = slashify("$sitedir/$sbName.css"); |
44
|
3
|
|
|
|
|
22
|
writeUTF8File($sbCssFile, $sbCssContent); |
45
|
|
|
|
|
|
|
|
46
|
3
|
|
|
|
|
16
|
my $systemCSSContent = <
|
47
|
|
|
|
|
|
|
\@charset "UTF-8"; |
48
|
|
|
|
|
|
|
\@import url($sbName.css); |
49
|
|
|
|
|
|
|
SYSCSS |
50
|
|
|
|
|
|
|
|
51
|
3
|
|
|
|
|
97
|
my $inUserCSSFile = $args->getCSS(); |
52
|
3
|
50
|
|
|
|
10
|
if ($inUserCSSFile) |
53
|
|
|
|
|
|
|
{ |
54
|
0
|
|
|
|
|
0
|
my $outUserCSSFile = slashify("$sitedir/user.css"); |
55
|
0
|
0
|
|
|
|
0
|
copy($inUserCSSFile, $outUserCSSFile) || die("Failed to copy CSS '$inUserCSSFile' => '$outUserCSSFile': $!\n"); |
56
|
0
|
|
|
|
|
0
|
$systemCSSContent .= "\@import url(user.css)"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
3
|
|
|
|
|
26
|
my $sysCssName = $self->getSystemCssName(); |
60
|
3
|
|
|
|
|
27
|
my $systemCSSFile = slashify("$sitedir/$sysCssName.css"); |
61
|
3
|
|
|
|
|
12
|
writeUTF8File($systemCSSFile, $systemCSSContent); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub getStyleName |
66
|
|
|
|
|
|
|
{ |
67
|
9
|
|
|
9
|
0
|
21
|
my $self = shift; |
68
|
|
|
|
|
|
|
|
69
|
9
|
|
|
|
|
135
|
return $self->{stylename}; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub getSystemCssName |
73
|
|
|
|
|
|
|
{ |
74
|
15
|
|
|
15
|
0
|
53
|
return 'pods2site'; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _getCssContent |
78
|
|
|
|
0
|
|
|
{ |
79
|
|
|
|
|
|
|
# do nothing |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |