Patch/Role/Patch.pm

filter: Statementstmt 64.5% 20 / 31 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 55.5% 5 / 9 Podpod 0.0% 0 / 2 totaltotal 54.3% 25 / 46 CC 4 SCAR 15.6
CC
4
Cov
57%
__ANON__
12.0
format_patch
6.0
__ANON__
2.0
CRAP 4.8
« Patch/Command/Squash.pm ↑ Summary Patch/Command/Clone.pm »
1 package Git::CPAN::Patch::Role::Patch;
2 5 our $AUTHORITY = 'cpan:YANICK';
3 5 $Git::CPAN::Patch::Role::Patch::VERSION = '2.5.2';
4 5 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 5 ▶use experimental qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
12 signatures
13 postderef
14 5 /;
15  
16 5 requires 'git_run';
17  
18 has patches => (
19 is => 'rw',
20 traits => [ 'Array' ],
21 isa => 'ArrayRef',
22 0 ▶ default => sub ($self) { [
Subroutine __ANON__: not called CC=1 SCAR=6.9
23 0 $self->git_run( 'format-patch', 'cpan/master' )
24 ] },
25 5 handles => {
26 add_patches => 'push',
27 all_patches => 'elements',
28 nbr_patches => 'count',
29 },
30 );
31  
32 0 ▶sub format_patch ($self) {
Subroutine format_patch: not called CC=2 SCAR=17.9
Pod undocumented
33 0 say for $self->all_patches;
34 }
35  
36 has module_name => (
37 is => 'ro',
38 isa => 'Str',
39 lazy => 1,
40 0 ▶ default => sub ($self) {
Subroutine __ANON__: not called CC=3 SCAR=24.8
41  
42 0 ▶ if (my $module = $self->git->run('config', 'cpan.module-name')) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $module = $self->git->run("config", "cpan.module-name")) 0 0 0
43 0 return $module
44 }
45  
46 0 my $last_commit = $self->git->run('rev-parse', '--verify', 'cpan/master');
47  
48 0 my $last = join "\n", $self->git->run( log => '--pretty=format:%b', '-n', 1, $last_commit );
49  
50 0 ▶ $last =~ /git-cpan-module: \s+ (.*?) \s+ git-cpan-version: \s+ (.*?) \s*$/sx
Branch: 1 branch
BranchTrueFalseTotal
$last =~ /git-cpan-module: \s+ (.*?) \s+ git-cpan-version: \s+ (.*?) \s*$/sx or die "Couldn't parse message (not cloned via git cpan import?):\n$last\n" 0 0 0
51 or die "Couldn't parse message (not cloned via git cpan import?):\n$last\n";
52  
53 0 $self->git->run('config', 'cpan.module-name', $1);
54  
55 0 return $1;
56 },
57 5 );
58  
59 0 ▶sub send_emails($self,@patches) {
Subroutine send_emails: not called CC=1 SCAR=6.9
Pod undocumented
60 0 my $to = 'bug-' . $self->module_name . '@rt.cpan.org';
61  
62 0 system 'git', "send-email", '--no-chain-reply-to', "--to", $to, @patches;
63 }
64  
65 5 1;
66  
67 __END__
« Patch/Command/Squash.pm ↑ Summary Patch/Command/Clone.pm »