line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Mirror::Tiny::Tempdir; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
5
|
use File::Temp (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
5
|
1
|
|
|
1
|
|
15
|
use File::Path (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
6
|
1
|
|
|
1
|
|
449
|
use File::pushd (); |
|
1
|
|
|
|
|
1151
|
|
|
1
|
|
|
|
|
226
|
|
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; |