line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
29510
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package File::Tempdir::ForPackage::FromArchive; |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
1
|
|
|
1
|
|
28
|
$File::Tempdir::ForPackage::FromArchive::AUTHORITY = 'cpan:KENTNL'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
{ |
9
|
|
|
|
|
|
|
$File::Tempdir::ForPackage::FromArchive::VERSION = '0.1.0'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: Inflate any archive to a temporary directory and work in it. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
789
|
use Moo; |
|
1
|
|
|
|
|
17079
|
|
|
1
|
|
|
|
|
5
|
|
16
|
1
|
|
|
1
|
|
2506
|
use Sub::Quote qw( quote_sub ); |
|
1
|
|
|
|
|
3289
|
|
|
1
|
|
|
|
|
161
|
|
17
|
|
|
|
|
|
|
extends 'File::Tempdir::ForPackage'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has archive => ( |
20
|
|
|
|
|
|
|
is => ro =>, |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
isa => ( |
23
|
|
|
|
|
|
|
## no critic (RequireInterpolationOfMetachars) |
24
|
|
|
|
|
|
|
quote_sub q| if ( not -r -e $_[0] ){ | . q| die "archive is not readable: $_[0]"; | . q| }| |
25
|
|
|
|
|
|
|
), |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
around _build__dir => sub { |
29
|
|
|
|
|
|
|
my ( $orig, $self, @rest ) = @_; |
30
|
|
|
|
|
|
|
require Archive::Any; |
31
|
|
|
|
|
|
|
my $dir = $orig->( $self, @rest ); |
32
|
|
|
|
|
|
|
my $archive = Archive::Any->new( $self->archive ); |
33
|
|
|
|
|
|
|
$archive->extract($dir); |
34
|
|
|
|
|
|
|
return $dir; |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
1
|
|
6
|
no Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |