blib/lib/Module/Setup/Plugin/VC/Git.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 12 / 12 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 98.0% 51 / 52 CC 9 SCAR 18.2
CC
9
Cov
100%
check_skeleton_directory
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.1
« blib/lib/Module/Setup.pm ↑ Summary blib/lib/Module/Setup/Test/Flavor.pm »
1 package Module::Setup::Plugin::VC::Git;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base 'Module::Setup::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 ▶sub register {
Subroutine register: called CC=1 SCAR=0.0
Pod undocumented
7 8 my($self, ) = @_;
8 8 $self->add_trigger( check_skeleton_directory => \&check_skeleton_directory );
9 8 ▶ $self->add_trigger( append_template_file => sub { $self->append_template_file(@_) } );
Subroutine __ANON__: called CC=1 SCAR=0.0
10 }
11  
12 7 ▶sub check_skeleton_directory {
Subroutine check_skeleton_directory: called CC=9 SCAR=22.0
Pod documented
13 7 my $self = shift;
14 7 ▶ return unless $self->dialog("Git init? [Yn] ", 'y') =~ /[Yy]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->dialog("Git init? [Yn] ", "y") =~ /[Yy]/ 2 5 7
15  
16 5 ▶ !$self->system('git', 'init') or die $?;
Branch: 1 branch
BranchTrueFalseTotal
$self->system("git", "init") and die $? 1 4 5
17 4 ▶ !$self->system('git', 'add', '.gitignore') or die $?;
Branch: 1 branch
BranchTrueFalseTotal
$self->system("git", "add", ".gitignore") and die $? 1 3 4
18  
19 3 my $dir = Module::Setup::Path::Dir->new('.');
20 3 ▶ while (my $path = $dir->next) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $path = $dir->next) 34 3 37
21 34 ▶ next if $path eq '.' || $path eq '..' || $path eq '.git';
Branch: 1 branch
BranchTrueFalseTotal
if $path eq "." or $path eq ".." or $path eq ".git" 7 27 34
Condition100%6/6
$path eq "." or $path eq ".." or $path eq ".git"
l!l&&r!l&&!r
6127
$path eq "." or $path eq ".."
l!l&&r!l&&!r
3328
MC/DC100%3/3
$path eq "." or $path eq ".." or $path eq ".git"
$path eq "." $path eq ".." $path eq ".git"
Truth table100%4/4
A or B or C
A= $path eq "."B= $path eq ".."C= $path eq ".git"
ABCresult
1XX1
01X1
0011
0000
22 27 $self->system('git', 'add', $path);
23 }
24 3 ▶ !$self->system('git', 'commit', '-m', 'initial commit') or die $?;
Branch: 1 branch
BranchTrueFalseTotal
not $self->system("git", "commit", "-m", "initial commit") or die $? 2 1 3
25 }
26  
27 2 1;
28  
29  
30 =head1 NAME
31  
32 Module::Setup::Plugin::VC::Git - Git plugin
33  
34 =head1 SYNOPSIS
35  
36 module-setup --init --plugin=VC::Git
37  
38 =head1 SEE ALSO
39  
40 original L<http://gist.github.com/13374> by dann
41  
42 =cut
43  
44 __DATA__
« blib/lib/Module/Setup.pm ↑ Summary blib/lib/Module/Setup/Test/Flavor.pm »