| 1 | 4 | ▶ | use 5.008; # utf8 |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | package Git::PurePerl::Walker::OnCommit::CallBack; | ||
| 7 | |||
| 8 | 4 | our $VERSION = '0.004000'; | |
| 9 | |||
| 10 | # ABSTRACT: Execute a sub() for each commit | ||
| 11 | |||
| 12 | 4 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |
| 13 | |||
| 14 | 4 | ▶ | use Moose qw( with has ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 4 | ▶ | use MooseX::Types::Moose qw( CodeRef ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 4 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | 4 | with qw( Git::PurePerl::Walker::Role::OnCommit ); | |
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | 4 | has callback => ( | |
| 55 | handles => { do_callback => 'execute', }, | ||
| 56 | is => 'rw', | ||
| 57 | isa => CodeRef, | ||
| 58 | required => 1, | ||
| 59 | traits => [qw( Code )], | ||
| 60 | ); | ||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | sub handle { | ||
| 69 | 5 | ▶ | my ( $self, $commit ) = @_; |
|
Subroutine
handle: called CC=1 SCAR=0.0
Pod
documented
| |||
| 70 | 5 | $self->do_callback($commit); | |
| 71 | 5 | return $self; | |
| 72 | } | ||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | ## no critic ( Subroutines::ProhibitBuiltinHomonyms ) | ||
| 81 | sub reset { | ||
| 82 | 1 | ▶ | return shift; |
|
Subroutine
reset: called CC=1 SCAR=0.0
Pod
documented
| |||
| 83 | } | ||
| 84 | ## use critic | ||
| 85 | |||
| 86 | 4 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 87 | 4 | __PACKAGE__->meta->make_immutable; | |
| 88 | 4 | 1; | |
| 89 | |||
| 90 | __END__ | ||
| 91 | |||
| 92 | =pod | ||
| 93 | |||
| 94 | =encoding UTF-8 | ||
| 95 | |||
| 96 | =head1 NAME | ||
| 97 | |||
| 98 | Git::PurePerl::Walker::OnCommit::CallBack - Execute a sub() for each commit | ||
| 99 | |||
| 100 | =head1 VERSION | ||
| 101 | |||
| 102 | version 0.004000 | ||
| 103 | |||
| 104 | =head1 CONSTRUCTOR ARGUMENTS | ||
| 105 | |||
| 106 | =head2 callback | ||
| 107 | |||
| 108 | =head1 ATTRIBUTES | ||
| 109 | |||
| 110 | =head2 callback | ||
| 111 | |||
| 112 | =head1 ATTRIBUTE GENERATED METHODS | ||
| 113 | |||
| 114 | =head2 callback | ||
| 115 | |||
| 116 | =head2 do_callback | ||
| 117 | |||
| 118 | =head1 INHERITED METHODS | ||
| 119 | |||
| 120 | =head2 for_repository | ||
| 121 | |||
| 122 | L<< C<Git::PurePerl::B<Walker::Role::HasRepo>-E<gt>I<for_repository( $repo )>>|Git::PurePerl::Walker::Role::HasRepo/for_repository >> | ||
| 123 | |||
| 124 | =head2 clone | ||
| 125 | |||
| 126 | L<< C<MooseX::B<Clone>-E<gt>I<clone( %params )>>|MooseX::Clone/clone-params >> | ||
| 127 | |||
| 128 | =head2 _repo | ||
| 129 | |||
| 130 | L<< C<Git::PurePerl::B<Walker::Role::HasRepo>-E<gt>I<_repo( $repo )>>|Git::PurePerl::Walker::Role::HasRepo/_repo >> | ||
| 131 | |||
| 132 | =head1 CONSUMED ROLES | ||
| 133 | |||
| 134 | =head2 Git::PurePerl::Walker::Role::OnCommit | ||
| 135 | |||
| 136 | L<< C<Git::PurePerl::B<Walker::Role::OnCommit>>|Git::PurePerl::Walker::Role::OnCommit >> | ||
| 137 | |||
| 138 | =head1 ROLE SATISFYING METHODS | ||
| 139 | |||
| 140 | =head2 handle | ||
| 141 | |||
| 142 | L<< C<Git::PurePerl::B<Walker::Role::OnCommit>-E<gt>I<handle( $commit )>>|Git::PurePerl::Walker::Role::OnCommit/handle >> | ||
| 143 | |||
| 144 | =head2 reset | ||
| 145 | |||
| 146 | L<< C<Git::PurePerl::B<Walker::Role::OnCommit>-E<gt>I<reset()>>|Git::PurePerl::Walker::Role::OnCommit/reset >> | ||
| 147 | |||
| 148 | =head1 AUTHOR | ||
| 149 | |||
| 150 | Kent Fredric <kentnl@cpan.org> | ||
| 151 | |||
| 152 | =head1 COPYRIGHT AND LICENSE | ||
| 153 | |||
| 154 | This software is copyright (c) 2014 by Kent Fredric <kentnl@cpan.org>. | ||
| 155 | |||
| 156 | This is free software; you can redistribute it and/or modify it under | ||
| 157 | the same terms as the Perl 5 programming language system itself. | ||
| 158 | |||
| 159 | =cut | ||