| 1 | package Git::CPAN::Patch::Role::Patch; | ||||||||||
| 2 | 5 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | 5 | $Git::CPAN::Patch::Role::Patch::VERSION = '2.3.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 Method::Signatures::Simple; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 5 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 5 | requires 'git_run'; | |||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | has patches => ( | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 16 | 0 | is => 'rw', | |||||||||
| 17 | traits => [ 'Array' ], | ||||||||||
| 18 | 5 | isa => 'ArrayRef', | |||||||||
| 19 | default => method { [ | ||||||||||
| 20 | $self->git_run( 'format-patch', 'cpan/master' ) | ||||||||||
| 21 | ] }, | ||||||||||
| 22 | handles => { | ||||||||||
| 23 | add_patches => 'push', | ||||||||||
| 24 | all_patches => 'elements', | ||||||||||
| 25 | 5 | ▶ | nbr_patches => 'count', | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=4.1
Subroutine
format_patch: not called CC=2 SCAR=15.1
Subroutine
__ANON__: not called CC=2 SCAR=15.1
| |||||||||||
| 26 | 0 | }, | |||||||||
| 27 | 5 | ); | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | method format_patch { | ||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||
| 30 | say for $self->all_patches; | ||||||||||
| 31 | 0 | ▶ | } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | ||||||||||
| 33 | has module_name => ( | ||||||||||
| 34 | is => 'ro', | ||||||||||
| 35 | 0 | isa => 'Str', | |||||||||
| 36 | lazy => 1, | ||||||||||
| 37 | 0 | default => method { | |||||||||
| 38 | |||||||||||
| 39 | 0 | ▶ | if (my $module = $self->git->run('config', 'cpan.module-name')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | return $module | ||||||||||
| 41 | } | ||||||||||
| 42 | 0 | ||||||||||
| 43 | my $last_commit = $self->git->run('rev-parse', '--verify', 'cpan/master'); | ||||||||||
| 44 | 0 | ||||||||||
| 45 | my $last = join "\n", $self->git->run( log => '--pretty=format:%b', '-n', 1, $last_commit ); | ||||||||||
| 46 | 5 | ||||||||||
| 47 | $last =~ /git-cpan-module: \s+ (.*?) \s+ git-cpan-version: \s+ (.*?) \s*$/sx | ||||||||||
| 48 | 5 | ▶ | or die "Couldn't parse message (not cloned via git cpan import?):\n$last\n"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=3.5
Subroutine
__ANON__: not called CC=1 SCAR=4.6
| |||||||||||
| 49 | 0 | ||||||||||
| 50 | $self->git->run('config', 'cpan.module-name', $1); | ||||||||||
| 51 | 0 | ||||||||||
| 52 | 5 | return $1; | |||||||||
| 53 | }, | ||||||||||
| 54 | 5 | ); | |||||||||
| 55 | |||||||||||
| 56 | method send_emails(@patches) { | ||||||||||
| 57 | my $to = 'bug-' . $self->module_name . '@rt.cpan.org'; | ||||||||||
| 58 | |||||||||||
| 59 | system 'git', "send-email", '--no-chain-reply-to', "--to", $to, @patches; | ||||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 1; | ||||||||||
| 63 | |||||||||||
| 64 | __END__ | ||||||||||
| 65 | |||||||||||
| 66 | =pod | ||||||||||
| 67 | |||||||||||
| 68 | =encoding UTF-8 | ||||||||||
| 69 | |||||||||||
| 70 | =head1 NAME | ||||||||||
| 71 | |||||||||||
| 72 | Git::CPAN::Patch::Role::Patch | ||||||||||
| 73 | |||||||||||
| 74 | =head1 VERSION | ||||||||||
| 75 | |||||||||||
| 76 | version 2.3.2 | ||||||||||
| 77 | |||||||||||
| 78 | =head1 AUTHOR | ||||||||||
| 79 | |||||||||||
| 80 | Yanick Champoux <yanick@cpan.org> | ||||||||||
| 81 | |||||||||||
| 82 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 83 | |||||||||||
| 84 | This software is copyright (c) 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009 by Yanick Champoux. | ||||||||||
| 85 | |||||||||||
| 86 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 87 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 88 | |||||||||||
| 89 | =cut | ||||||||||