| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::Pods2Site::Pod2HTML; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
57
|
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
118
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.001'; |
|
7
|
|
|
|
|
|
|
my $version = $VERSION; |
|
8
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
|
9
|
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
18
|
use App::Pods2Site::Util qw(slashify createSpinner); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
107
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
13
|
use File::Basename; |
|
|
2
|
|
|
|
|
10
|
|
|
|
2
|
|
|
|
|
131
|
|
|
13
|
2
|
|
|
2
|
|
13
|
use File::Path qw(make_path); |
|
|
2
|
|
|
|
|
1208
|
|
|
|
2
|
|
|
|
|
126
|
|
|
14
|
2
|
|
|
2
|
|
994
|
use Pod::Html; |
|
|
2
|
|
|
|
|
23279
|
|
|
|
2
|
|
|
|
|
1201
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# CTOR |
|
17
|
|
|
|
|
|
|
# |
|
18
|
|
|
|
|
|
|
sub new |
|
19
|
|
|
|
|
|
|
{ |
|
20
|
3
|
|
|
3
|
0
|
11
|
my $class = shift; |
|
21
|
3
|
|
|
|
|
7
|
my $args = shift; |
|
22
|
3
|
|
|
|
|
8
|
my $podRoot = shift; |
|
23
|
3
|
|
|
|
|
16
|
my $workGroups = shift; |
|
24
|
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
41
|
my $self = bless( { generated => 0, uptodate => 0 }, $class); |
|
26
|
3
|
|
|
|
|
31
|
$self->__updateHTML($args, $podRoot, $workGroups); |
|
27
|
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
39
|
return $self; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub getGenerated |
|
32
|
|
|
|
|
|
|
{ |
|
33
|
3
|
|
|
3
|
0
|
11
|
my $self = shift; |
|
34
|
|
|
|
|
|
|
|
|
35
|
3
|
|
|
|
|
16
|
return $self->{generated}; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub getUptodate |
|
39
|
|
|
|
|
|
|
{ |
|
40
|
3
|
|
|
3
|
0
|
6
|
my $self = shift; |
|
41
|
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
141
|
return $self->{uptodate}; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# PRIVATE |
|
46
|
|
|
|
|
|
|
# |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub __updateHTML |
|
49
|
|
|
|
|
|
|
{ |
|
50
|
3
|
|
|
3
|
|
13
|
my $self = shift; |
|
51
|
3
|
|
|
|
|
6
|
my $args = shift; |
|
52
|
3
|
|
|
|
|
10
|
my $podRoot = shift; |
|
53
|
3
|
|
|
|
|
6
|
my $workGroups = shift; |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# get the work tree pod root, and create a podpath |
|
56
|
|
|
|
|
|
|
# |
|
57
|
3
|
|
|
|
|
7
|
my @sections; |
|
58
|
3
|
|
|
|
|
26
|
push(@sections, $_->{group}) foreach (@$workGroups); |
|
59
|
3
|
|
|
|
|
20
|
my $podpath = join(':', @sections); |
|
60
|
|
|
|
|
|
|
|
|
61
|
3
|
|
|
|
|
15
|
my $spinner = createSpinner($args); |
|
62
|
|
|
|
|
|
|
|
|
63
|
3
|
|
|
|
|
7
|
my $count = 0; |
|
64
|
3
|
|
|
|
|
10
|
foreach my $workGroup (@$workGroups) |
|
65
|
|
|
|
|
|
|
{ |
|
66
|
6
|
|
|
|
|
13
|
foreach my $podName (keys(%{$workGroup->{podinfo}})) |
|
|
6
|
|
|
|
|
74
|
|
|
67
|
|
|
|
|
|
|
{ |
|
68
|
10
|
|
|
|
|
21
|
$count++; |
|
69
|
|
|
|
|
|
|
|
|
70
|
10
|
|
|
|
|
38
|
my $podfile = $workGroup->{podinfo}->{$podName}->{podfile}; |
|
71
|
|
|
|
|
|
|
|
|
72
|
10
|
|
|
|
|
34
|
my $outfile = $podfile; |
|
73
|
10
|
|
|
|
|
221
|
$outfile =~ s/^\Q$podRoot\E.//; |
|
74
|
10
|
|
|
|
|
87
|
$outfile =~ s/\.[^.]+$//; |
|
75
|
10
|
|
|
|
|
70
|
$outfile = slashify($outfile, '/'); |
|
76
|
|
|
|
|
|
|
|
|
77
|
10
|
|
50
|
|
|
73
|
my $htmlroot = ('..' x ($outfile =~ tr#/##)) || '.'; |
|
78
|
10
|
|
|
|
|
42
|
$htmlroot =~ s#\.\.(?=\.)#../#g; |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# place all pod2html generated files in the pod2html dir |
|
81
|
|
|
|
|
|
|
# |
|
82
|
10
|
|
|
|
|
29
|
my $relOutFile = "pod2html/$outfile.html"; |
|
83
|
10
|
|
|
|
|
56
|
$outfile = slashify($args->getSiteDir() . "/$relOutFile"); |
|
84
|
|
|
|
|
|
|
|
|
85
|
10
|
|
|
|
|
29
|
$workGroup->{podinfo}->{$podName}->{htmlfile} = $outfile; |
|
86
|
|
|
|
|
|
|
|
|
87
|
10
|
|
|
|
|
159
|
my $mtimePodfile = (stat($podfile))[9]; |
|
88
|
10
|
|
100
|
|
|
225
|
my $mtimeOutfile = (stat($outfile))[9] || 0; |
|
89
|
|
|
|
|
|
|
|
|
90
|
10
|
100
|
66
|
|
|
129
|
if (!-e $outfile || $mtimePodfile > $mtimeOutfile) |
|
91
|
|
|
|
|
|
|
{ |
|
92
|
7
|
|
|
|
|
344
|
my $outfileDir = dirname($outfile); |
|
93
|
7
|
100
|
|
|
|
1078
|
(!-d $outfileDir ? make_path($outfileDir) : 1) || die ("Failed to create directory '$outfileDir': $!\n"); |
|
|
|
50
|
|
|
|
|
|
|
94
|
7
|
|
|
|
|
64
|
my @p2hargs = |
|
95
|
|
|
|
|
|
|
( |
|
96
|
|
|
|
|
|
|
"--infile=$podfile", |
|
97
|
|
|
|
|
|
|
"--outfile=$outfile", |
|
98
|
|
|
|
|
|
|
"--podroot=$podRoot", |
|
99
|
|
|
|
|
|
|
"--podpath=$podpath", |
|
100
|
|
|
|
|
|
|
"--htmlroot=$htmlroot", |
|
101
|
|
|
|
|
|
|
"--css=$htmlroot/../pods2site.css", |
|
102
|
|
|
|
|
|
|
); |
|
103
|
7
|
50
|
|
|
|
42
|
if (!$args->isVerboseLevel(2)) |
|
104
|
|
|
|
|
|
|
{ |
|
105
|
7
|
|
|
|
|
18
|
push(@p2hargs, '--quiet'); |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
else |
|
108
|
|
|
|
|
|
|
{ |
|
109
|
0
|
0
|
|
|
|
0
|
push(@p2hargs, '--verbose') if $args->isVerboseLevel(3); |
|
110
|
|
|
|
|
|
|
} |
|
111
|
7
|
|
|
|
|
54
|
pod2html(@p2hargs); |
|
112
|
|
|
|
|
|
|
|
|
113
|
7
|
|
|
|
|
54204
|
$self->{generated}++; |
|
114
|
|
|
|
|
|
|
|
|
115
|
7
|
50
|
|
|
|
73
|
$args->isVerboseLevel(1) |
|
116
|
|
|
|
|
|
|
? print "Generating '$outfile'...\n" |
|
117
|
|
|
|
|
|
|
: $spinner->($count); |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
else |
|
120
|
|
|
|
|
|
|
{ |
|
121
|
3
|
|
|
|
|
21
|
$self->{uptodate}++; |
|
122
|
|
|
|
|
|
|
|
|
123
|
3
|
50
|
|
|
|
25
|
$args->isVerboseLevel(1) |
|
124
|
|
|
|
|
|
|
? print "Skipping uptodate '$outfile'\n" |
|
125
|
|
|
|
|
|
|
: $spinner->($count); |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
} |
|
128
|
|
|
|
|
|
|
} |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |