CPAN/Maker/Bootstrapper/Role/ScaffoldImporter.pm

filter: Statementstmt 66.6% 22 / 33 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 58.0% 29 / 50 CC 5 SCAR 25.7
CC
5
Cov
54%
cmd_import_scaffold
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 13.1
« CPAN/Maker/Bootstrapper/Role/DistFile.pm ↑ Summary CPAN/Maker/Bootstrapper/Role/Provides.pm »
1 package CPAN::Maker::Bootstrapper::Role::ScaffoldImporter;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use CLI::Simple::Constants qw(:booleans);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use CLI::Simple::Utils qw(slurp choose);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Cwd qw(abs_path);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use English qw(-no_match_vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 ########################################################################
14 0 ▶sub cmd_import_scaffold {
Subroutine cmd_import_scaffold: not called CC=5 SCAR=34.0
Pod undocumented
15 ########################################################################
16 0 my ($self) = @_;
17  
18 0 my ($tarball) = $self->get_args;
19  
20 0 ▶ die "ERROR: tarball argument required\n"
Branch: 1 branch
BranchTrueFalseTotal
unless $tarball 0 0 0
21 if !$tarball;
22  
23 0 ▶ die "ERROR: $tarball not found\n"
Branch: 1 branch
BranchTrueFalseTotal
unless -e $tarball 0 0 0
24 if !-e $tarball;
25  
26 0 $tarball = abs_path($tarball);
27  
28 0 my $tmpdir = File::Temp::tempdir( CLEANUP => $TRUE );
29  
30 0 require Archive::Tar;
31  
32 0 ▶ chdir $tmpdir
Branch: 1 branch
BranchTrueFalseTotal
chdir $tmpdir or die "ERROR: could not chdir to $tmpdir\n" 0 0 0
33 or die "ERROR: could not chdir to $tmpdir\n";
34  
35 0 ▶ Archive::Tar->extract_archive( $tarball, 1 )
Branch: 1 branch
BranchTrueFalseTotal
"Archive::Tar"->extract_archive($tarball, 1) or die "ERROR: could not extract ${tarball}: " . "Archive::Tar"->error . "\n" 0 0 0
36 or die "ERROR: could not extract $tarball: " . Archive::Tar->error . "\n";
37  
38 0 $self->set_import( [$tmpdir] );
39  
40 0 return $self->cmd_install;
41 }
42  
43 2 1;
« CPAN/Maker/Bootstrapper/Role/DistFile.pm ↑ Summary CPAN/Maker/Bootstrapper/Role/Provides.pm »