line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
545
|
use 5.006; # our |
|
3
|
|
|
|
|
14
|
|
2
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
86
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
260
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dist::Zilla::Util::EmulatePhase::PrereqCollector; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.001002'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#ABSTRACT: A dummy Dist::Zilla to fake a 'prereq' object on. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
534
|
use Moose qw( has ); |
|
3
|
|
|
|
|
378878
|
|
|
3
|
|
|
|
|
24
|
|
14
|
3
|
|
|
3
|
|
17718
|
use namespace::autoclean; |
|
3
|
|
|
|
|
6468
|
|
|
3
|
|
|
|
|
23
|
|
15
|
3
|
|
|
3
|
|
620
|
use Dist::Zilla::Prereqs; |
|
3
|
|
|
|
|
90148
|
|
|
3
|
|
|
|
|
1456
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has shadow_zilla => ( |
30
|
|
|
|
|
|
|
is => 'ro', |
31
|
|
|
|
|
|
|
isa => 'Ref', |
32
|
|
|
|
|
|
|
required => 1, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has prereqs => ( |
36
|
|
|
|
|
|
|
is => 'ro', |
37
|
|
|
|
|
|
|
isa => 'Dist::Zilla::Prereqs', |
38
|
|
|
|
|
|
|
init_arg => undef, |
39
|
|
|
|
|
|
|
default => sub { Dist::Zilla::Prereqs->new }, |
40
|
|
|
|
|
|
|
handles => [qw( register_prereqs )], |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
## no critic ( Subroutines::RequireArgUnpacking ) |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub find_files { |
52
|
0
|
|
|
0
|
1
|
0
|
return shift->shadow_zilla->find_files(@_); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub plugins { |
60
|
0
|
|
|
0
|
1
|
0
|
return []; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
## no critic ( Subroutines::RequireArgUnpacking, Subroutines::ProhibitUnusedPrivateSubroutines, Subroutines::ProtectPrivateSubs ) |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
my $white_list = [ |
74
|
|
|
|
|
|
|
[ 'Dist::Zilla::Plugin::MakeMaker', 'Dist::Zilla::Plugin::MakeMaker::register_prereqs' ], |
75
|
|
|
|
|
|
|
[ 'Dist::Zilla::Plugin::MakeMaker::Awesome', 'Dist::Zilla::Plugin::MakeMaker::Awesome::register_prereqs' ], |
76
|
|
|
|
|
|
|
]; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub _is_white_listed { |
79
|
1
|
|
|
1
|
|
2
|
my ( undef, $package, $subroutine ) = @_; |
80
|
1
|
|
|
|
|
1
|
for my $list_rule ( @{$white_list} ) { |
|
1
|
|
|
|
|
2
|
|
81
|
1
|
50
|
|
|
|
13
|
next unless $package->isa( $list_rule->[0] ); |
82
|
1
|
50
|
|
|
|
3
|
next unless $subroutine eq $list_rule->[1]; |
83
|
1
|
|
|
|
|
4
|
return 1; |
84
|
|
|
|
|
|
|
} |
85
|
0
|
|
|
|
|
0
|
return; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub _share_dir_map { |
89
|
1
|
|
|
1
|
|
211
|
my $self = shift; |
90
|
1
|
|
|
|
|
11
|
my $package = [ caller 0 ]->[0]; |
91
|
|
|
|
|
|
|
## no critic (ProhibitMagicNumbers) |
92
|
1
|
|
|
|
|
7
|
my $subroutine = [ caller 1 ]->[3]; |
93
|
|
|
|
|
|
|
|
94
|
1
|
50
|
|
|
|
3
|
if ( $self->_is_white_listed( $package, $subroutine ) ) { |
95
|
1
|
|
|
|
|
34
|
return $self->shadow_zilla->_share_dir_map(@_); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
my $message = <<'_MSG_'; |
99
|
|
|
|
|
|
|
[Dist::Zilla::Util::EmulatePhase] Call to self->zilla->_share_dir_map should be avoided |
100
|
|
|
|
|
|
|
... and your package/sub ( %s::%s ) is not listed in the WhiteList. |
101
|
|
|
|
|
|
|
... Please try eliminate this call to a private method or request it being whitelisted |
102
|
|
|
|
|
|
|
_MSG_ |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
require Carp; |
105
|
0
|
|
|
|
|
|
Carp::croak( sprintf $message, $package, $subroutine ); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
3
|
|
|
3
|
|
25
|
no Moose; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
20
|
|
109
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
110
|
|
|
|
|
|
|
1; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
__END__ |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=pod |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=encoding UTF-8 |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 NAME |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Dist::Zilla::Util::EmulatePhase::PrereqCollector - A dummy Dist::Zilla to fake a 'prereq' object on. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 VERSION |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
version 1.001002 |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 METHODS |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head2 find_files |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
L<< C<Dist::Zilla>'s C<find_files>|Dist::Zilla/find_files >> proxy. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 plugins |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head2 _share_dir_map |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
L<< C<Dist::Zilla>'s C<_share_dir_map>|Dist::Zilla/_share_dir_map >> proxy. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
B<WARNING>: This method is provided as a temporary workaround and may eventually disappear, |
139
|
|
|
|
|
|
|
as the behaviour it is wrapping probably shouldn't be done like this. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=begin MetaPOD::JSON v1.1.0 |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
{ |
144
|
|
|
|
|
|
|
"namespace":"Dist::Zilla::Util::EmulatePhase::PrereqCollector", |
145
|
|
|
|
|
|
|
"interface":"class", |
146
|
|
|
|
|
|
|
"inherits":"Moose::Object" |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=end MetaPOD::JSON |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 AUTHOR |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
161
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=cut |