| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::DynamicManifest; |
|
2
|
|
|
|
|
|
|
BEGIN { |
|
3
|
1
|
|
|
1
|
|
774
|
$Dist::Zilla::Plugin::DynamicManifest::VERSION = '0.0019'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
|
|
|
|
|
|
# ABSTRACT: Dynamically build a sane MANIFEST |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
9
|
use Moose; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
|
|
with qw/ Dist::Zilla::Role::FilePruner /; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has pruner => qw/ is ro lazy_build 1 isa CodeRef /; |
|
12
|
|
|
|
|
|
|
sub _build_pruner { |
|
13
|
0
|
|
|
0
|
|
|
return sub { m{^(?! |
|
14
|
|
|
|
|
|
|
bin/| |
|
15
|
|
|
|
|
|
|
script/| |
|
16
|
|
|
|
|
|
|
TODO$| |
|
17
|
|
|
|
|
|
|
lib/.+(?<!ROADMAP)\.p(m|od)$| |
|
18
|
|
|
|
|
|
|
inc/| |
|
19
|
|
|
|
|
|
|
t/| |
|
20
|
|
|
|
|
|
|
Makefile\.PL$| |
|
21
|
|
|
|
|
|
|
README$| |
|
22
|
|
|
|
|
|
|
MANIFEST$| |
|
23
|
|
|
|
|
|
|
Changes$| |
|
24
|
|
|
|
|
|
|
META\.json$| |
|
25
|
|
|
|
|
|
|
META\.yml$| |
|
26
|
|
|
|
|
|
|
[^\/]+\.xs$ |
|
27
|
|
|
|
|
|
|
)}x } |
|
28
|
0
|
|
|
0
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub prune_files { |
|
31
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
32
|
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $prune = $self->pruner; |
|
34
|
0
|
|
|
|
|
|
my $files = $self->zilla->files; |
|
35
|
0
|
|
|
|
|
|
@$files = grep { |
|
36
|
0
|
|
|
|
|
|
my $file = $_; |
|
37
|
0
|
|
|
|
|
|
local $_ = $file->name; |
|
38
|
0
|
0
|
|
|
|
|
if ( $prune->( $file ) ) { |
|
39
|
0
|
|
|
|
|
|
$self->log_debug([ 'pruning %s', $file->name ]); |
|
40
|
0
|
|
|
|
|
|
0; |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
else { |
|
43
|
0
|
|
|
|
|
|
1; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
} @$files; |
|
46
|
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return; |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
52
|
1
|
|
|
1
|
|
7066
|
no Moose; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
7
|
|
|
53
|
|
|
|
|
|
|
1; |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |
|
56
|
|
|
|
|
|
|
=pod |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 NAME |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Dist::Zilla::Plugin::DynamicManifest - Dynamically build a sane MANIFEST |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 VERSION |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
version 0.0019 |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
In your L<Dist::Zilla> C<dist.ini>: |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
[DynamicManifest] |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
DynamicManifest will build a sane MANIFEST without the need for manually specifying MANIFEST or MANIFEST.SKIP. |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
In essence, DynamicManifest is a built-in MANIFEST.SKIP that will prune everything that doesn't look like it should be included. Specifically, it will use the following regular expression for pruning: |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
m{^(?! |
|
79
|
|
|
|
|
|
|
bin/| |
|
80
|
|
|
|
|
|
|
script/| |
|
81
|
|
|
|
|
|
|
TODO$| |
|
82
|
|
|
|
|
|
|
lib/.+(?<!ROADMAP)\.p(m|od)$| |
|
83
|
|
|
|
|
|
|
inc/| |
|
84
|
|
|
|
|
|
|
t/| |
|
85
|
|
|
|
|
|
|
Makefile\.PL$| |
|
86
|
|
|
|
|
|
|
README$| |
|
87
|
|
|
|
|
|
|
MANIFEST$| |
|
88
|
|
|
|
|
|
|
Changes$| |
|
89
|
|
|
|
|
|
|
META\.json$| |
|
90
|
|
|
|
|
|
|
META\.yml$| |
|
91
|
|
|
|
|
|
|
\.xs$ |
|
92
|
|
|
|
|
|
|
)}x |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Robert Krimen <robertkrimen@gmail.com> |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This software is copyright (c) 2011 by Robert Krimen. |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
103
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
|
106
|
|
|
|
|
|
|
|