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