Makefile_git.PL

filter: Statementstmt 55.0% 11 / 20 Branchbran 40.0% 4 / 10 Conditioncond 25.0% 3 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 50.0% 1 / 2 Podpod n/a totaltotal 38.0% 19 / 50 CC 3 SCAR 22.2
CC
3
Cov
43%
parse_args
12.0
BEGIN
1.0
CRAP 9.2
« blib/lib/Dist/Zilla/Plugin/Git/GatherDir.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/Git/Check.pm »
1 #
2 # This file is part of Dist-Zilla-Plugin-Git
3 #
4 # This software is copyright (c) 2009 by Jerome Quelin.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 # this section comes from Makefile.git.PL and is inserted into Makefile.PL
10 # Git 1.5.4 introduced the --exclude-standard option to git ls-files,
11 # which Git::Check needs to work properly.
12 1 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 my $need_version = version->parse('1.5.4');
14 eval {
15 1 ▶ my $git_version = `git --version` or die "Unable to execute git\n";
Branch: 1 branch
BranchTrueFalseTotal
my $git_version = `git --version` or die "Unable to execute git\n" 1 0 1
16 1 ▶ $git_version =~ /git \s+ version \s* ( \d+ (?: \.\d+ )+ )( [-.]rc\d+)?/x
Branch: 1 branch
BranchTrueFalseTotal
$git_version =~ /git \s+ version \s* ( \d+ (?: \.\d+ )+ )( [-.]rc\d+)?/x or die "Unable to determine git version\n" 1 0 1
17 or die "Unable to determine git version\n";
18 1 ▶ my $rc = $2 || '';
Condition50%1/2
$2 || ''
l!l
01
MC/DC0%0/1
$2 || ''
$2
Truth table50%1/2
A
A= $2
Aresult
11
00
19  
20 1 $git_version = version->parse("$1");
21 1 ▶ die "git $need_version or later required, you have $git_version$rc\n"
Branch: 1 branch
BranchTrueFalseTotal
if $git_version < $need_version or $git_version == $need_version and $rc 0 1 1
Condition33%2/6
$git_version < $need_version or $git_version == $need_version and $rc
l!l&&r!l&&!r
001
$git_version == $need_version and $rc
!ll&&!rl&&r
100
MC/DC0%0/3
$git_version < $need_version or $git_version == $need_version and $rc
$git_version < $need_version $git_version == $need_version $rc
Truth table25%1/4
A or B and C
A= $git_version < $need_versionB= $git_version == $need_versionC= $rc
ABCresult
1XX1
0111
00X0
0100
22 if $git_version < $need_version or $git_version == $need_version and $rc;
23 1 1;
24 1 ▶} or do {
Branch: 1 branch
BranchTrueFalseTotal
eval { do { my $git_version = `git --version` or die "Unable to execute git\n"; $git_version =~ /git \s+ version \s* ( \d+ (?: \.\d+ )+ )( [-.]rc\d+)?/x or die "Unable to determine git version\n"; my $rc = $2 || ""; $git_version = "version"->parse("$1"); die "git $need_version or later required, you have $git_version$rc\n" if $git_version < $need_version or $git_version == $need_version and $rc; 1 } } or do { print $@; if (parse_args()->{"FORCE_INSTALL"}) { print "FORCE_INSTALL specified, attempting to install anyway.\n"; } else { print "\nDist::Zilla::Plugin::Git requires git $need_version or later in your PATH,\nand it wasn't found. If you want to install anyway, run\n\n PERL_MM_OPT=FORCE_INSTALL $^X Makefile.PL\n"; exit 0; } } 1 0 1
25 0 print $@;
26  
27 0 ▶ if (parse_args()->{FORCE_INSTALL}) {
Branch: 1 branch
BranchTrueFalseTotal
if (parse_args()->{'FORCE_INSTALL'}) { } 0 0 0
28 0 print "FORCE_INSTALL specified, attempting to install anyway.\n";
29 } else {
30 0 print <<"END MESSAGE";
31 \nDist::Zilla::Plugin::Git requires git $need_version or later in your PATH,
32 and it wasn't found. If you want to install anyway, run
33  
34 PERL_MM_OPT=FORCE_INSTALL $^X Makefile.PL
35 END MESSAGE
36  
37 0 exit 0; # Indicate missing non-Perl prerequisite
38 } # end else not FORCE_INSTALL
39 }; # end do when Git prerequisite is not met
40  
41 0 ▶sub parse_args {
Subroutine parse_args: not called CC=3 SCAR=24.8
42 0 require ExtUtils::MakeMaker;
43 0 require Text::ParseWords;
44 ExtUtils::MakeMaker::parse_args(
45 my $tmp = {},
46 0 ▶ Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''),
Condition0%0/2
$ENV{'PERL_MM_OPT'} || ''
l!l
00
MC/DC0%0/1
$ENV{'PERL_MM_OPT'} || ''
$ENV{'PERL_MM_OPT'}
Truth table0%0/2
A
A= $ENV{'PERL_MM_OPT'}
Aresult
11
00
47 @ARGV,
48 );
49 0 ▶ return $tmp->{ARGS} || {};
Condition0%0/2
$tmp->{'ARGS'} || {}
l!l
00
MC/DC0%0/1
$tmp->{'ARGS'} || {}
$tmp->{'ARGS'}
Truth table0%0/2
A
A= $tmp->{'ARGS'}
Aresult
11
00
50 }
« blib/lib/Dist/Zilla/Plugin/Git/GatherDir.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/Git/Check.pm »