line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Mirror::Tiny::Tempdir; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
5
|
use File::Temp (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
5
|
1
|
|
|
1
|
|
13
|
use File::Path (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
6
|
1
|
|
|
1
|
|
469
|
use File::pushd (); |
|
1
|
|
|
|
|
1249
|
|
|
1
|
|
|
|
|
168
|
|
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
0
|
|
sub as_string { shift->{tempdir} } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
0
|
|
|
0
|
0
|
|
my ($class, $base) = @_; |
12
|
0
|
|
|
|
|
|
my $tempdir = File::Temp::tempdir(CLEANUP => 0, DIR => $base); |
13
|
0
|
|
|
|
|
|
bless { tempdir => $tempdir }, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub pushd { |
17
|
0
|
|
|
0
|
0
|
|
my ($class, $base) = @_; |
18
|
0
|
|
|
|
|
|
my $self = $class->new($base); |
19
|
0
|
|
|
|
|
|
$self->{guard} = File::pushd::pushd($self->as_string); |
20
|
0
|
|
|
|
|
|
$self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub DESTROY { |
24
|
0
|
|
|
0
|
|
|
my $self = shift; |
25
|
0
|
|
|
|
|
|
undef $self->{guard}; |
26
|
0
|
|
|
|
|
|
local ($@, $!); |
27
|
0
|
|
|
|
|
|
eval { File::Path::rmtree($self->{tempdir}) }; |
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |