| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# vim: set ts=2 sts=2 sw=2 expandtab smarttab: |
|
2
|
|
|
|
|
|
|
# |
|
3
|
|
|
|
|
|
|
# This file is part of Config-MVP-BundleInspector |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# This software is copyright (c) 2013 by Randy Stauner. |
|
6
|
|
|
|
|
|
|
# |
|
7
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
|
8
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
|
9
|
|
|
|
|
|
|
# |
|
10
|
1
|
|
|
1
|
|
1010
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
43
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
83
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Config::MVP::BundleInspector; |
|
14
|
|
|
|
|
|
|
{ |
|
15
|
|
|
|
|
|
|
$Config::MVP::BundleInspector::VERSION = '0.001'; |
|
16
|
|
|
|
|
|
|
} |
|
17
|
|
|
|
|
|
|
# git description: 5002d73 |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
BEGIN { |
|
20
|
1
|
|
|
1
|
|
18
|
$Config::MVP::BundleInspector::AUTHORITY = 'cpan:RWSTAUNER'; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
# ABSTRACT: Determine prereqs and INI string from PluginBundles |
|
23
|
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
2187
|
use Class::Load (); |
|
|
1
|
|
|
|
|
42748
|
|
|
|
1
|
|
|
|
|
29
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
627
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use MooseX::AttributeShortcuts; |
|
28
|
|
|
|
|
|
|
use MooseX::Types::Moose qw( Str ArrayRef HashRef ); |
|
29
|
|
|
|
|
|
|
use MooseX::Types::Perl qw( PackageName Identifier ); |
|
30
|
|
|
|
|
|
|
use namespace::autoclean; |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# lots of lazy builders for subclasses |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has bundle_class => ( |
|
36
|
|
|
|
|
|
|
is => 'ro', |
|
37
|
|
|
|
|
|
|
isa => PackageName, |
|
38
|
|
|
|
|
|
|
required => 1, |
|
39
|
|
|
|
|
|
|
); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has bundle_method => ( |
|
43
|
|
|
|
|
|
|
is => 'lazy', |
|
44
|
|
|
|
|
|
|
isa => Identifier, |
|
45
|
|
|
|
|
|
|
); |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _build_bundle_method { |
|
48
|
|
|
|
|
|
|
'mvp_bundle_config' |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
has bundle_name => ( |
|
53
|
|
|
|
|
|
|
is => 'lazy', |
|
54
|
|
|
|
|
|
|
isa => Str, |
|
55
|
|
|
|
|
|
|
); |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _build_bundle_name { |
|
58
|
|
|
|
|
|
|
return $_[0]->bundle_class; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
has plugin_specs => ( |
|
63
|
|
|
|
|
|
|
is => 'lazy', |
|
64
|
|
|
|
|
|
|
isa => ArrayRef, |
|
65
|
|
|
|
|
|
|
); |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub _build_plugin_specs { |
|
68
|
|
|
|
|
|
|
my ($self) = @_; |
|
69
|
|
|
|
|
|
|
my $class = $self->bundle_class; |
|
70
|
|
|
|
|
|
|
my $method = $self->bundle_method; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Class::Load::load_class($class); |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
return $self->_plugin_specs_from_bundle_method($class, $method); |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _plugin_specs_from_bundle_method { |
|
78
|
|
|
|
|
|
|
my ($self, $class, $method) = @_; |
|
79
|
|
|
|
|
|
|
return [ |
|
80
|
|
|
|
|
|
|
$class->$method({ |
|
81
|
|
|
|
|
|
|
name => $self->bundle_name, |
|
82
|
|
|
|
|
|
|
payload => {}, |
|
83
|
|
|
|
|
|
|
}) |
|
84
|
|
|
|
|
|
|
]; |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
has prereqs => ( |
|
89
|
|
|
|
|
|
|
is => 'lazy', |
|
90
|
|
|
|
|
|
|
isa => 'CPAN::Meta::Requirements', |
|
91
|
|
|
|
|
|
|
); |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub _build_prereqs { |
|
94
|
|
|
|
|
|
|
my ($self) = @_; |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
require CPAN::Meta::Requirements; |
|
97
|
|
|
|
|
|
|
my $prereqs = CPAN::Meta::Requirements->new; |
|
98
|
|
|
|
|
|
|
foreach my $spec ( @{ $self->plugin_specs } ){ |
|
99
|
|
|
|
|
|
|
my (undef, $class, $payload) = @$spec; |
|
100
|
|
|
|
|
|
|
$payload ||= {}; |
|
101
|
|
|
|
|
|
|
$prereqs->add_minimum($class => $payload->{':version'} || 0) |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
return $prereqs; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
has ini_string => ( |
|
109
|
|
|
|
|
|
|
is => 'lazy', |
|
110
|
|
|
|
|
|
|
isa => Str, |
|
111
|
|
|
|
|
|
|
); |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
has ini_opts => ( |
|
115
|
|
|
|
|
|
|
is => 'lazy', |
|
116
|
|
|
|
|
|
|
isa => HashRef, |
|
117
|
|
|
|
|
|
|
); |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub _build_ini_opts { |
|
120
|
|
|
|
|
|
|
return {}; |
|
121
|
|
|
|
|
|
|
} |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub _build_ini_string { |
|
124
|
|
|
|
|
|
|
my ($self) = @_; |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
require Config::MVP::Writer::INI; |
|
127
|
|
|
|
|
|
|
my $string = Config::MVP::Writer::INI->new($self->ini_opts) |
|
128
|
|
|
|
|
|
|
->ini_string($self->plugin_specs); |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
return $string; |
|
131
|
|
|
|
|
|
|
} |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
134
|
|
|
|
|
|
|
1; |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
__END__ |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=pod |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=encoding utf-8 |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=for :stopwords Randy Stauner ACKNOWLEDGEMENTS INI PluginBundles cpan testmatrix url |
|
143
|
|
|
|
|
|
|
annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata |
|
144
|
|
|
|
|
|
|
placeholders metacpan |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 NAME |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Config::MVP::BundleInspector - Determine prereqs and INI string from PluginBundles |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 VERSION |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
version 0.001 |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
my $inspector = Config::MVP::BundleInspector->new( |
|
157
|
|
|
|
|
|
|
bundle_class => 'SomeApp::PluginBundle::Stuff', |
|
158
|
|
|
|
|
|
|
); |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
$inspector->prereqs; |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
This module gathers info about the plugin specs from a L<Config::MVP> C<PluginBundle>. |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head2 bundle_class |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
The class to inspect. |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head2 bundle_method |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
The class method to call that returns the list of plugin specs. |
|
175
|
|
|
|
|
|
|
Defaults to C<mvp_bundle_config> |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=head2 bundle_name |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Passed to the class method in a hashref as the C<name> value. |
|
180
|
|
|
|
|
|
|
Defaults to L</bundle_class>. |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head2 plugin_specs |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
An arrayref of plugin specs returned from the L</bundle_class>. |
|
185
|
|
|
|
|
|
|
A plugin spec is an array ref of: |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
[ $name, $package, \%payload ] |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head2 prereqs |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
A L<CPAN::Meta::Requirements> object representing the prerequisites |
|
192
|
|
|
|
|
|
|
as determined from the plugin specs. |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=head2 ini_string |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
A string representing the bundle's contents in INI format. |
|
197
|
|
|
|
|
|
|
Generated from the plugin specs by L<Config::MVP::Writer::INI>. |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head2 ini_opts |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Options to pass to L<Config::MVP::Writer::INI>. |
|
202
|
|
|
|
|
|
|
Defaults to an empty hashref. |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=head1 SUPPORT |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head2 Perldoc |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
perldoc Config::MVP::BundleInspector |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=head2 Websites |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
The following websites have more information about this module, and may be of help to you. As always, |
|
215
|
|
|
|
|
|
|
in addition to those websites please use your favorite search engine to discover more resources. |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=over 4 |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=item * |
|
220
|
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
Search CPAN |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
The default CPAN search engine, useful to view POD in HTML format. |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/Config-MVP-BundleInspector> |
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=item * |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
RT: CPAN's Bug Tracker |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Config-MVP-BundleInspector> |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=item * |
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
CPAN Ratings |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
The CPAN Ratings is a website that allows community ratings and reviews of Perl modules. |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/Config-MVP-BundleInspector> |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=item * |
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
CPAN Testers |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions. |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
L<http://www.cpantesters.org/distro/C/Config-MVP-BundleInspector> |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=item * |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
CPAN Testers Matrix |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
L<http://matrix.cpantesters.org/?dist=Config-MVP-BundleInspector> |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=item * |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
CPAN Testers Dependencies |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
L<http://deps.cpantesters.org/?module=Config::MVP::BundleInspector> |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=back |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
Please report any bugs or feature requests by email to C<bug-config-mvp-bundleinspector at rt.cpan.org>, or through |
|
272
|
|
|
|
|
|
|
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Config-MVP-BundleInspector>. You will be automatically notified of any |
|
273
|
|
|
|
|
|
|
progress on the request by the system. |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=head2 Source Code |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
L<https://github.com/rwstauner/Config-MVP-BundleInspector> |
|
279
|
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
git clone https://github.com/rwstauner/Config-MVP-BundleInspector.git |
|
281
|
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=head1 AUTHOR |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
Randy Stauner <rwstauner@cpan.org> |
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
This software is copyright (c) 2013 by Randy Stauner. |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
291
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=cut |