line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
6
|
|
|
6
|
|
544
|
use 5.006; # pragmas |
|
6
|
|
|
|
|
29
|
|
2
|
6
|
|
|
6
|
|
24
|
use strict; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
126
|
|
3
|
6
|
|
|
6
|
|
22
|
use warnings; |
|
6
|
|
|
|
|
5
|
|
|
6
|
|
|
|
|
1137
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::File::ShareDir::Object::Inc; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.001002'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Shared tempdir object code to inject into @INC |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my @cache; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use Class::Tiny { |
28
|
|
|
|
|
|
|
tempdir => sub { |
29
|
5
|
|
|
|
|
36
|
require Path::Tiny; |
30
|
5
|
|
|
|
|
16
|
my $dir = Path::Tiny::tempdir( CLEANUP => 1 ); |
31
|
5
|
|
|
|
|
84326
|
push @cache, $dir; # explicit keepalive |
32
|
5
|
|
|
|
|
37
|
return $dir; |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
module_tempdir => sub { |
35
|
3
|
|
|
|
|
295
|
my ($self) = @_; |
36
|
3
|
|
|
|
|
41
|
my $dir = $self->tempdir->child('auto/share/module'); |
37
|
3
|
|
|
|
|
73
|
$dir->mkpath(); |
38
|
3
|
|
|
|
|
858
|
return $dir->absolute; |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
dist_tempdir => sub { |
41
|
2
|
|
|
|
|
250
|
my ($self) = @_; |
42
|
2
|
|
|
|
|
37
|
my $dir = $self->tempdir->child('auto/share/dist'); |
43
|
2
|
|
|
|
|
66
|
$dir->mkpath(); |
44
|
2
|
|
|
|
|
821
|
return $dir->absolute; |
45
|
|
|
|
|
|
|
}, |
46
|
6
|
|
|
6
|
|
423
|
}; |
|
6
|
|
|
|
|
2205
|
|
|
6
|
|
|
|
|
92
|
|
47
|
6
|
|
|
6
|
|
2637
|
use Carp qw( carp ); |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
1105
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub add_to_inc { |
68
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
69
|
0
|
|
|
|
|
0
|
carp 'add_to_inc deprecated sice 1.001000, use register instead'; |
70
|
0
|
|
|
|
|
0
|
return $self->register; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub register { |
86
|
5
|
|
|
5
|
1
|
48
|
my ($self) = @_; |
87
|
5
|
|
|
|
|
92
|
unshift @INC, $self->tempdir->stringify; |
88
|
5
|
|
|
|
|
59
|
return; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub clear { |
104
|
2
|
|
|
2
|
1
|
12
|
my ($self) = @_; |
105
|
|
|
|
|
|
|
## no critic (Variables::RequireLocalizedPunctuationVars) |
106
|
2
|
50
|
|
|
|
4
|
@INC = grep { ref or $_ ne $self->tempdir->stringify } @INC; |
|
22
|
|
|
|
|
451
|
|
107
|
2
|
|
|
|
|
21
|
return; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
__END__ |