line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
142603
|
use 5.006; |
|
3
|
|
|
|
|
9
|
|
2
|
3
|
|
|
3
|
|
13
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
63
|
|
3
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
209
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dist::Zilla::Util::RoleDB; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.004001'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Shared code for things that communicate data about dzil roles. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
1490
|
use Moo qw( has ); |
|
3
|
|
|
|
|
29857
|
|
|
3
|
|
|
|
|
14
|
|
14
|
3
|
|
|
3
|
|
3096
|
use Carp qw( croak ); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
412
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
## no critic (NamingConventions) |
17
|
|
|
|
|
|
|
my $is_ArrayRef = sub { |
18
|
|
|
|
|
|
|
return 'ARRAY' eq ref $_[0] unless $_[1]; |
19
|
|
|
|
|
|
|
return unless 'ARRAY' eq ref $_[0]; |
20
|
|
|
|
|
|
|
for ( @{ $_[0] } ) { |
21
|
|
|
|
|
|
|
return unless $_[1]->($_); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
has items => ( |
33
|
|
|
|
|
|
|
isa => sub { |
34
|
|
|
|
|
|
|
$is_ArrayRef->( $_[0], sub { $_[0]->isa('Dist::Zilla::Util::RoleDB::Entry') } ) or croak 'Must be ArrayRef[ RoleDB::Entry ]'; |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
is => ro =>, |
37
|
|
|
|
|
|
|
lazy => 1, |
38
|
|
|
|
|
|
|
builder => '_build_items', |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
3
|
|
13
|
no Moo; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
12
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _build_items { |
44
|
2
|
|
|
2
|
|
1164
|
require Dist::Zilla::Util::RoleDB::Items; |
45
|
2
|
|
|
|
|
9
|
return [ Dist::Zilla::Util::RoleDB::Items->all() ]; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub roles { |
55
|
1
|
|
|
1
|
1
|
1370
|
my ($self) = @_; |
56
|
1
|
|
|
|
|
2
|
return @{ [ sort { $a->name cmp $b->name } @{ $self->items } ] }; |
|
1
|
|
|
|
|
1
|
|
|
193
|
|
|
|
|
183
|
|
|
1
|
|
|
|
|
15
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub phases { |
66
|
1
|
|
|
1
|
1
|
1758
|
my ($self) = @_; |
67
|
1
|
|
|
|
|
2
|
return @{ [ sort { $a->name cmp $b->name } grep { $_->is_phase } @{ $self->items } ] }; |
|
1
|
|
|
|
|
3
|
|
|
23
|
|
|
|
|
184
|
|
|
54
|
|
|
|
|
104
|
|
|
1
|
|
|
|
|
29
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=pod |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=encoding UTF-8 |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 NAME |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Dist::Zilla::Util::RoleDB - Shared code for things that communicate data about dzil roles. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 VERSION |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
version 0.004001 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 DESCRIPTION |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This utility is a hard-coded list of various known C<Dist::Zilla> roles and their properties. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
It's not generally usable by most people, and is more useful for query tools, such as |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
dzil dumpphases |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Certain entries may have additional markers indicating they are C<phase> roles, |
95
|
|
|
|
|
|
|
and will have relevant data indicating what methods are invoked in that C<phase>. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 METHODS |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 C<roles> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Returns a list of all roles in the database, sorted by name. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head2 C<phases> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Returns a list of all roles that are also phases, sorted by name. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 C<items> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Contains all items in this data set, as an array ref. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 AUTHOR |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
122
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |