line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
124
|
use 5.010001; |
|
5
|
|
|
|
|
24
|
|
2
|
5
|
|
|
5
|
|
38
|
use strict; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
116
|
|
3
|
5
|
|
|
5
|
|
42
|
use warnings; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
306
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Story::Interact::PageSource::Dir; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.001013'; |
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
37
|
use Moo; |
|
5
|
|
|
|
|
22
|
|
|
5
|
|
|
|
|
43
|
|
11
|
5
|
|
|
5
|
|
2187
|
use Types::Common -types; |
|
5
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
51
|
|
12
|
5
|
|
|
5
|
|
74757
|
use Types::Path::Tiny -types; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
44
|
|
13
|
5
|
|
|
5
|
|
7408
|
use namespace::clean; |
|
5
|
|
|
|
|
30
|
|
|
5
|
|
|
|
|
57
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
with 'Story::Interact::PageSource'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has 'dir' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
isa => Dir, |
20
|
|
|
|
|
|
|
coerce => 1, |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get_source_code { |
25
|
46
|
|
|
46
|
0
|
207
|
my ( $self, $page_id ) = @_; |
26
|
46
|
|
|
|
|
270
|
my $file = $self->dir->child( join q[.], $page_id, 'page.pl' ); |
27
|
46
|
100
|
|
|
|
2185
|
return unless $file->exists; |
28
|
34
|
|
|
|
|
925
|
return $file->slurp_utf8; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub all_page_ids { |
32
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
33
|
0
|
|
|
|
|
|
map $_->basename( '.page.pl' ), $self->dir->children( qr/\.page\.pl\z/ ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |