line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
1758060
|
use 5.006; # our |
|
5
|
|
|
|
|
13
|
|
2
|
5
|
|
|
5
|
|
21
|
use strict; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
115
|
|
3
|
5
|
|
|
5
|
|
37
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
339
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Git::PurePerl::Walker::Method::FirstParent; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.004001'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Walk down a tree following the first parent. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
|
5
|
|
448
|
use Moose qw( with has ); |
|
5
|
|
|
|
|
302475
|
|
|
5
|
|
|
|
|
39
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
with qw( Git::PurePerl::Walker::Role::Method ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has '_commit' => ( isa => 'Maybe[ Object ]', is => 'rw', lazy_build => 1 ); |
56
|
|
|
|
|
|
|
has 'start' => ( isa => 'Str', is => 'rw', required => 1 ); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub _build__commit { |
63
|
2
|
|
|
2
|
|
3
|
my ($self) = @_; |
64
|
2
|
|
|
|
|
64
|
return $self->_repo->get_object( $self->start ); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub current { |
74
|
6
|
|
|
6
|
1
|
2289
|
my ($self) = @_; |
75
|
6
|
|
|
|
|
206
|
return $self->_commit; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub has_next { |
85
|
6
|
|
|
6
|
1
|
11
|
my ($self) = @_; |
86
|
6
|
50
|
|
|
|
194
|
if ( not $self->_commit ) { |
87
|
0
|
|
|
|
|
0
|
return; |
88
|
|
|
|
|
|
|
} |
89
|
6
|
100
|
|
|
|
167
|
if ( not $self->_commit->parent ) { |
90
|
3
|
|
|
|
|
163
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
3
|
|
|
|
|
8092
|
return 1; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
## no critic (Subroutines::ProhibitBuiltinHomonyms) |
102
|
|
|
|
|
|
|
sub next { |
103
|
3
|
|
|
3
|
1
|
1037
|
my ($self) = @_; |
104
|
3
|
|
|
|
|
6
|
my $commit; |
105
|
3
|
|
|
|
|
11
|
$self->_commit( $commit = $self->peek_next ); |
106
|
3
|
|
|
|
|
7
|
return $commit; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
## use critic |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub peek_next { |
117
|
5
|
|
|
5
|
1
|
856
|
my $commit = (shift)->_commit->parent; |
118
|
5
|
|
|
|
|
10843
|
return $commit; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
## no critic ( Subroutines::ProhibitBuiltinHomonyms ) |
128
|
|
|
|
|
|
|
sub reset { |
129
|
1
|
|
|
1
|
1
|
1
|
my ($self) = @_; |
130
|
1
|
|
|
|
|
29
|
$self->_commit( $self->_repo->get_object( $self->start ) ); |
131
|
1
|
|
|
|
|
9
|
return $self; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
## use critic |
134
|
|
|
|
|
|
|
|
135
|
5
|
|
|
5
|
|
19938
|
no Moose; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
21
|
|
136
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
137
|
|
|
|
|
|
|
1; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
__END__ |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=pod |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=encoding UTF-8 |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 NAME |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Git::PurePerl::Walker::Method::FirstParent - Walk down a tree following the first parent. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 VERSION |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
version 0.004001 |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 CONSTRUCTOR ARGUMENTS |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 start |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head2 start |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head1 ATTRIBUTE GENERATED METHODS |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head2 start |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head1 INHERITED METHODS |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head2 for_repository |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::HasRepo>-E<gt>I<for_repository( $repo )>>|Git::PurePerl::Walker::Role::HasRepo/for_repository >> |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head2 clone |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
L<< C<MooseX::B<Clone>-E<gt>I<clone( %params )>>|MooseX::Clone/clone-params >> |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head2 _repo |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::HasRepo>-E<gt>I<_repo( $repo )>>|Git::PurePerl::Walker::Role::HasRepo/_repo >> |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head1 PRIVATE CONSTRUCTOR ARGUMENTS |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head2 _commit |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head1 PRIVATE ATTRIBUTES |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head2 _commit |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head1 PRIVATE METHODS |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head2 _build_commit |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head1 PRIVATE ATTRIBUTE GENERATED METHODS |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head2 _commit |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head1 CONSUMED ROLES |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head2 Git::PurePerl::Walker::Role::Method |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>>|Git::PurePerl::Walker::Role::Method >> |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head1 ROLE SATISFYING METHODS |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head2 current |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<current()>>|Git::PurePerl::Walker::Role::Method/current >> |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=head2 has_next |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<has_next()>>|Git::PurePerl::Walker::Role::Method/has_next >> |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=head2 next |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<next()>>|Git::PurePerl::Walker::Role::Method/next >> |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=head2 peek_next |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<peek_next()>>|Git::PurePerl::Walker::Role::Method/peek_next >> |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=head2 reset |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
L<< C<Git::PurePerl::B<Walker::Role::Method>-E<gt>I<reset()>>|Git::PurePerl::Walker::Role::Method/reset >> |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=head1 AUTHOR |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>. |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
232
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=cut |