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

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