Patch/Command/Update.pm

filter: Statementstmt 73.5% 25 / 34 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod n/a totaltotal 67.3% 31 / 46 CC 3 SCAR 11.0
CC
3
Cov
66%
__ANON__
6.0
__ANON__
6.0
BEGIN
1.0
CRAP 3.0
« Patch/Command/Squash.pm ↑ Summary Patch.pm »
1 package Git::CPAN::Patch::Command::Update;
2 1 our $AUTHORITY = 'cpan:YANICK';
3 #ABSTRACT: Import the latest version of a module and rebase the current branch
4 1 $Git::CPAN::Patch::Command::Update::VERSION = '2.3.2';
5 1 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Method::Signatures::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Git::Repository;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use MooseX::App::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 extends 'Git::CPAN::Patch::Command::Import';
16  
17  
18 #TODO check for versions before download
19  
20 1 has last_import_before_run => (
21 is => 'rw',
22 );
23  
24 0 ▶before run => method {
Subroutine __ANON__: not called CC=2 SCAR=17.9
25 0 ▶ eval { $self->set_last_import_before_run($self->last_commit) }
Branch: 1 branch
BranchTrueFalseTotal
eval { do { $self->set_last_import_before_run($self->last_commit) } } or die "branch 'cpan/master' doesn't exist yet (import first)\n" 0 0 0
26 or die "branch 'cpan/master' doesn't exist yet (import first)\n";
27 0 $self->set_thing_to_import( $self->tracked_distribution );
28 1 };
29  
30 0 ▶after run => method {
Subroutine __ANON__: not called CC=2 SCAR=17.9
31 0 ▶ return if $self->last_import_before_run eq $self->last_commit;
Branch: 1 branch
BranchTrueFalseTotal
if $self->last_import_before_run eq $self->last_commit 0 0 0
32  
33 0 $self->git_run( rebase => 'cpan/master' );
34 1 };
35  
36  
37 1 __PACKAGE__->meta->make_immutable;
38  
39 1 1;
40  
41 __END__
42  
43 =pod
44  
45 =encoding UTF-8
46  
47 =head1 NAME
48  
49 Git::CPAN::Patch::Command::Update - Import the latest version of a module and rebase the current branch
50  
51 =head1 VERSION
52  
53 version 2.3.2
54  
55 =head1 SYNOPSIS
56  
57 % git-cpan update
58  
59 =head1 DESCRIPTION
60  
61 This command runs C<git-cpan import>, and then if C<cpan/master> was updated
62 runs C<git rebase cpan/master>, bringing your patches up to date with the
63 upstream.
64  
65 =head1 AUTHORS
66  
67 Yuval Kogman C<< <nothingmuch@woobling.org> >>
68  
69 Yanick Champoux C<< <yanick@cpan.org> >>
70  
71 =head1 SEE ALSO
72  
73 L<Git::CPAN::Patch>, L<git-cpan-import>
74  
75 =head1 AUTHOR
76  
77 Yanick Champoux <yanick@cpan.org>
78  
79 =head1 COPYRIGHT AND LICENSE
80  
81 This software is copyright (c) 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009 by Yanick Champoux.
82  
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85  
86 =cut
« Patch/Command/Squash.pm ↑ Summary Patch.pm »