line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Pods2Site;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
62937
|
use 5.010_001;
|
|
2
|
|
|
|
|
10
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
8
|
use strict;
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
42
|
|
6
|
2
|
|
|
2
|
|
8
|
use warnings;
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
114
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.003';
|
9
|
|
|
|
|
|
|
my $version = $VERSION;
|
10
|
|
|
|
|
|
|
$VERSION = eval $VERSION;
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
801
|
use App::Pods2Site::Args;
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
63
|
|
13
|
2
|
|
|
2
|
|
777
|
use App::Pods2Site::PodFinder;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
53
|
|
14
|
2
|
|
|
2
|
|
681
|
use App::Pods2Site::PodCopier;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
51
|
|
15
|
2
|
|
|
2
|
|
682
|
use App::Pods2Site::Pod2HTML;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
67
|
|
16
|
2
|
|
|
2
|
|
14
|
use App::Pods2Site::Util qw(slashify);
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
77
|
|
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
11
|
use Cwd;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
75
|
|
19
|
2
|
|
|
2
|
|
9
|
use File::Basename;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
91
|
|
20
|
2
|
|
|
2
|
|
11
|
use File::Copy;
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
90
|
|
21
|
2
|
|
|
2
|
|
10
|
use File::Path qw(make_path);
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1114
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# main entry point
|
24
|
|
|
|
|
|
|
#
|
25
|
|
|
|
|
|
|
sub main
|
26
|
|
|
|
|
|
|
{
|
27
|
3
|
|
|
3
|
0
|
5703
|
my $args = App::Pods2Site::Args->new($version, @_);
|
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
|
|
49
|
my $cwd = slashify(getcwd());
|
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
18
|
my $workdir = $args->getWorkDir();
|
32
|
3
|
50
|
|
|
|
49
|
chdir($workdir) || die("Failed to chdir to '$workdir': $!\n");
|
33
|
|
|
|
|
|
|
|
34
|
3
|
50
|
|
|
|
16
|
if ($args->isVerboseLevel(0))
|
35
|
|
|
|
|
|
|
{
|
36
|
3
|
|
|
|
|
95
|
print "Scanning for pods in:\n";
|
37
|
3
|
|
|
|
|
22
|
print " $_\n" foreach ($args->getBinDirs(), $args->getLibDirs());
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
33
|
my $podFinder = App::Pods2Site::PodFinder->new($args);
|
41
|
3
|
|
|
|
|
23
|
my ($sum, $partCounts) = $podFinder->getCounts();
|
42
|
3
|
50
|
|
|
|
29
|
die("No pods found!\n") unless $sum;
|
43
|
|
|
|
|
|
|
|
44
|
3
|
|
|
|
|
38
|
my $mainpagename = $args->getMainpage();
|
45
|
3
|
|
|
|
|
13
|
my $mainpage;
|
46
|
3
|
50
|
|
|
|
16
|
if ($mainpagename eq ':std')
|
47
|
|
|
|
|
|
|
{
|
48
|
3
|
|
|
|
|
10
|
$mainpage = $mainpagename;
|
49
|
|
|
|
|
|
|
}
|
50
|
|
|
|
|
|
|
else
|
51
|
|
|
|
|
|
|
{
|
52
|
0
|
|
|
|
|
0
|
foreach my $group (@{$podFinder->getGroups()})
|
|
0
|
|
|
|
|
0
|
|
53
|
|
|
|
|
|
|
{
|
54
|
0
|
|
|
|
|
0
|
foreach my $pod (@{$group->{pods}})
|
|
0
|
|
|
|
|
0
|
|
55
|
|
|
|
|
|
|
{
|
56
|
0
|
0
|
|
|
|
0
|
if ($pod->{name} eq $mainpagename)
|
57
|
|
|
|
|
|
|
{
|
58
|
0
|
|
|
|
|
0
|
$mainpage = $pod->{name};
|
59
|
0
|
|
|
|
|
0
|
$mainpage =~ s{::}{/}g;
|
60
|
0
|
|
|
|
|
0
|
$mainpage = "pod2html/$group->{name}/$mainpage.html";
|
61
|
0
|
|
|
|
|
0
|
last;
|
62
|
|
|
|
|
|
|
}
|
63
|
|
|
|
|
|
|
}
|
64
|
|
|
|
|
|
|
}
|
65
|
|
|
|
|
|
|
}
|
66
|
3
|
50
|
|
|
|
14
|
die("Failed to find the main page pod named '$mainpagename'\n") unless $mainpage;
|
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
|
|
14
|
my $counts = '';
|
69
|
3
|
|
|
|
|
18
|
foreach my $groupDef (@{$args->getGroupDefs()})
|
|
3
|
|
|
|
|
11
|
|
70
|
|
|
|
|
|
|
{
|
71
|
6
|
100
|
|
|
|
21
|
$counts .= ', ' if $counts;
|
72
|
6
|
|
|
|
|
29
|
$counts .= "$groupDef->{name}=$partCounts->{$groupDef->{name}}";
|
73
|
|
|
|
|
|
|
}
|
74
|
3
|
50
|
|
|
|
15
|
print "Found $sum pods ($counts).\n" if $args->isVerboseLevel(0);
|
75
|
|
|
|
|
|
|
|
76
|
3
|
50
|
|
|
|
19
|
print "Preparing pod work tree\n" if $args->isVerboseLevel(0);
|
77
|
3
|
|
|
|
|
116
|
my $podCopier = App::Pods2Site::PodCopier->new($args, $podFinder);
|
78
|
3
|
50
|
|
|
|
8
|
print "Prepared ", $podCopier->getCount(), " files\n" if $args->isVerboseLevel(0);
|
79
|
|
|
|
|
|
|
|
80
|
3
|
|
|
|
|
40
|
my $siteDir = $args->getSiteDir();
|
81
|
3
|
100
|
|
|
|
42
|
if (!-d $siteDir)
|
82
|
|
|
|
|
|
|
{
|
83
|
2
|
50
|
|
|
|
225
|
make_path($siteDir) || die("Failed to create sitedir '$siteDir': $!\n");
|
84
|
|
|
|
|
|
|
}
|
85
|
|
|
|
|
|
|
|
86
|
3
|
|
|
|
|
37
|
my $sitebuilder = $args->getSiteBuilder();
|
87
|
|
|
|
|
|
|
|
88
|
3
|
|
|
|
|
74
|
$sitebuilder->prepareCss($args);
|
89
|
|
|
|
|
|
|
|
90
|
3
|
50
|
|
|
|
17
|
print "Generating HTML from pods\n" if $args->isVerboseLevel(0);
|
91
|
3
|
|
|
|
|
24
|
my $pod2html = App::Pods2Site::Pod2HTML->new($args, $podCopier->getPodRoot(), $podCopier->getWorkGroups());
|
92
|
|
|
|
|
|
|
|
93
|
3
|
50
|
|
|
|
35
|
print "Generated ", $pod2html->getGenerated(), " documents (", $pod2html->getUptodate(), " up to date)\n" if $args->isVerboseLevel(0);
|
94
|
|
|
|
|
|
|
|
95
|
3
|
|
|
|
|
46
|
$sitebuilder->makeSite($args, $podCopier->getWorkGroups(), $partCounts, $mainpage);
|
96
|
|
|
|
|
|
|
|
97
|
3
|
|
|
|
|
17
|
$args->finish();
|
98
|
|
|
|
|
|
|
|
99
|
3
|
|
|
|
|
20
|
my $style = $args->getStyle();
|
100
|
3
|
100
|
|
|
|
13
|
my $updatedOrCreated = $args->getUpdating() ? 'updated' : 'created';
|
101
|
3
|
50
|
|
|
|
13
|
print "Site $updatedOrCreated in '$siteDir' using style '$style'.\n" if $args->isVerboseLevel(0);
|
102
|
|
|
|
|
|
|
|
103
|
3
|
|
|
|
|
50
|
chdir($cwd);
|
104
|
|
|
|
|
|
|
|
105
|
3
|
|
|
|
|
1031
|
return 0;
|
106
|
|
|
|
|
|
|
}
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
1;
|