| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::RecordStream::Site; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "4.0.25"; |
|
4
|
|
|
|
|
|
|
|
|
5
|
70
|
|
|
70
|
|
760
|
use strict; |
|
|
70
|
|
|
|
|
120
|
|
|
|
70
|
|
|
|
|
1561
|
|
|
6
|
70
|
|
|
70
|
|
270
|
use warnings; |
|
|
70
|
|
|
|
|
133
|
|
|
|
70
|
|
|
|
|
1536
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
70
|
|
|
70
|
|
313
|
use Carp qw(croak); |
|
|
70
|
|
|
|
|
105
|
|
|
|
70
|
|
|
|
|
21514
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
{ |
|
11
|
|
|
|
|
|
|
my $bootstrapped; |
|
12
|
|
|
|
|
|
|
my %registry; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub bootstrap |
|
15
|
|
|
|
|
|
|
{ |
|
16
|
66
|
100
|
|
66
|
|
206
|
if($bootstrapped) |
|
17
|
|
|
|
|
|
|
{ |
|
18
|
59
|
|
|
|
|
120
|
return; |
|
19
|
|
|
|
|
|
|
} |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my @site_libs = ( |
|
22
|
|
|
|
|
|
|
(defined $ENV{RECS_SITELIB} ? $ENV{RECS_SITELIB} : ()), |
|
23
|
|
|
|
|
|
|
(defined $ENV{HOME} ? "$ENV{HOME}/.recs/site" : ()), |
|
24
|
7
|
50
|
|
|
|
71
|
map { "$_/Recs/Site" } @INC |
|
|
91
|
50
|
|
|
|
159
|
|
|
25
|
|
|
|
|
|
|
); |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# First we find all conceivable sites by looking for module files |
|
28
|
7
|
|
|
|
|
20
|
my %sites; |
|
29
|
7
|
|
|
|
|
24
|
for my $dir (@site_libs) |
|
30
|
|
|
|
|
|
|
{ |
|
31
|
98
|
50
|
|
|
|
1142
|
if(opendir(DIR, $dir)) |
|
32
|
|
|
|
|
|
|
{ |
|
33
|
0
|
|
|
|
|
0
|
while(my $site_module = readdir(DIR)) |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
0
|
0
|
0
|
|
|
0
|
next if($site_module eq "." || $site_module eq ".."); |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
0
|
if($site_module =~ /^(.*)\.pm$/) |
|
38
|
|
|
|
|
|
|
{ |
|
39
|
0
|
|
|
|
|
0
|
$sites{$1} = "$dir/$site_module"; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
} |
|
42
|
0
|
|
|
|
|
0
|
closedir(DIR); |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
7
|
|
|
|
|
28
|
delete $sites{'Bootstrap'}; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Then we try loading each of them (they register themselves) |
|
49
|
7
|
|
|
|
|
35
|
for my $site (sort(keys(%sites))) |
|
50
|
|
|
|
|
|
|
{ |
|
51
|
0
|
|
|
|
|
0
|
require $sites{$site}; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
7
|
|
|
|
|
38
|
$bootstrapped = 1; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub register_site |
|
58
|
|
|
|
|
|
|
{ |
|
59
|
0
|
|
|
0
|
0
|
0
|
my ($class, %args) = @_; |
|
60
|
|
|
|
|
|
|
|
|
61
|
0
|
|
0
|
|
|
0
|
my $name = delete($args{'name'}) || croak "No name given in registration?!\n"; |
|
62
|
0
|
|
0
|
|
|
0
|
my $priority = delete($args{'priority'}) || 0; |
|
63
|
0
|
|
0
|
|
|
0
|
my $path = delete($args{'path'}) || "App::RecordStream::Site::$name"; |
|
64
|
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
0
|
$registry{$name} = |
|
66
|
|
|
|
|
|
|
{ |
|
67
|
|
|
|
|
|
|
'name' => $name, |
|
68
|
|
|
|
|
|
|
'path' => $path, |
|
69
|
|
|
|
|
|
|
'priority' => $priority, |
|
70
|
|
|
|
|
|
|
}; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub list_sites |
|
74
|
|
|
|
|
|
|
{ |
|
75
|
66
|
|
|
66
|
0
|
217
|
return values(%registry); |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |