line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Hoborg; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
57255
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
80
|
|
6
|
1
|
|
|
1
|
|
825
|
use File::Slurp 'read_file'; |
|
1
|
|
|
|
|
14544
|
|
|
1
|
|
|
|
|
59
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
712
|
use version; our $VERSION = qv('0.0.6'); #(Hopefully) first |
|
1
|
|
|
|
|
3306
|
|
|
1
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
#non-test-failing version |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @appendices = qw(characters.md geography.md); #auxiliary and additional files |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Module implementation here |
14
|
|
|
|
|
|
|
sub new { |
15
|
1
|
|
|
1
|
1
|
366
|
my $class = shift; |
16
|
1
|
|
|
|
|
3
|
my $dir = shift; |
17
|
1
|
50
|
|
|
|
4
|
if ( ! $dir ) { |
18
|
1
|
50
|
|
|
|
23
|
$dir = -d "../text" ? "../text": "../../text"; |
19
|
1
|
50
|
|
|
|
13
|
$dir = -d $dir ? $dir : "t"; |
20
|
|
|
|
|
|
|
} |
21
|
1
|
|
|
|
|
3
|
my $text_file = "$dir/text.md"; |
22
|
1
|
|
|
|
|
8
|
my $text = read_file($text_file); |
23
|
1
|
|
|
|
|
376
|
my $self = { |
24
|
|
|
|
|
|
|
_dir => $dir, |
25
|
|
|
|
|
|
|
_text => $text, |
26
|
|
|
|
|
|
|
_text_file => $text_file, |
27
|
|
|
|
|
|
|
_appendices => {} |
28
|
|
|
|
|
|
|
}; |
29
|
1
|
|
|
|
|
3
|
for my $a (@appendices ) { |
30
|
2
|
|
|
|
|
6
|
$text_file = "$dir/$a"; |
31
|
2
|
|
|
|
|
5
|
$text = read_file($text_file); |
32
|
2
|
|
|
|
|
127
|
$self->{'_appendices'}{$a} = $text; |
33
|
|
|
|
|
|
|
} |
34
|
1
|
|
|
|
|
3
|
bless $self, $class; |
35
|
1
|
|
|
|
|
3
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub dir { |
39
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
40
|
0
|
|
|
|
|
0
|
return $self->{'_dir'}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub text { |
44
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
45
|
0
|
|
|
|
|
0
|
return $self->{'_text'}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub text_file { |
49
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
50
|
1
|
|
|
|
|
11
|
return $self->{'_text_file'}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub appendices { |
54
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
55
|
0
|
|
|
|
|
|
return $self->{'_appendices'}; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
"All over, all out, all over and out"; # Magic circus phrase said at the end of the show |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |