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

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 50.0% 1 / 2 totaltotal 41.6% 15 / 36 CC 5 SCAR 27.5
CC
5
Cov
39%
check_skeleton_directory
30.0
register
2.0
__ANON__
2.0
CRAP 15.7
↑ Summary
1 package Module::Setup::Plugin::VC::Bazaar;
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 our $VERSION = '0.03';
7 # this code is variation of Module::Setup::Plugin::VC::Git for VC::Bazaar. thx.
8
9 sub register
10 0 ▶{
Subroutine register: not called CC=1 SCAR=6.9
Pod undocumented
11 0 my $self = shift;
12 0 $self->add_trigger( check_skeleton_directory => \&check_skeleton_directory );
13 0 ▶ $self->add_trigger( append_template_file => sub { $self->append_template_file(@_) } );
Subroutine __ANON__: not called CC=1 SCAR=6.9
14 }
15
16 sub check_skeleton_directory
17 0 ▶{
Subroutine check_skeleton_directory: not called CC=5 SCAR=34.0
Pod documented
18 0 my $self = shift;
19 0 ▶ return unless $self->dialog("Bzr init? [Yn] ", 'y') =~ /[Yy]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->dialog("Bzr init? [Yn] ", "y") =~ /[Yy]/ 0 0 0
20
21 0 ▶ !$self->system(qw/bzr init/) or die $?;
Branch: 1 branch
BranchTrueFalseTotal
$self->system("bzr", "init") and die $? 0 0 0
22 0 ▶ !$self->system(qw/bzr add/) or die $?;
Branch: 1 branch
BranchTrueFalseTotal
$self->system("bzr", "add") and die $? 0 0 0
23
24 0 ▶ !$self->system(qw/bzr commit -m/, 'initial commit') or die $?;
Branch: 1 branch
BranchTrueFalseTotal
not $self->system(("bzr", "commit", "-m"), "initial commit") or die $? 0 0 0
25 }
26
27 1 1;
28
29 =head1 NAME
30
31 Module::Setup::Plugin::VC::Bazaar - Bazaar plugin
32
33 =head1 SYNOPSIS
34
35 module-setup --init --plugin=VC::Bazaar
36
37 =head1 AUTHOR
38
39 turugina E<lt>turugina {at} cpan.orgE<gt>
40
41 =head1 SEE ALSO
42
43 L<Module::Setup>
44
45 =head1 LICENSE
46
47 This library is free software; you can redistribute it and/or modify
48 it under the same terms as Perl itself.
49
50 =cut
51
52 __DATA__
↑ Summary