line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dist::Zilla::PluginBundle::Author::RUSSOZ; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
967
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: configure Dist::Zilla like RUSSOZ |
7
|
|
|
|
|
|
|
our $VERSION = '0.025'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4
|
use Moose 0.99; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
6
|
|
10
|
1
|
|
|
1
|
|
5411
|
use namespace::autoclean 0.09; |
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
5
|
|
11
|
1
|
|
|
1
|
|
301
|
use version; |
|
1
|
|
|
|
|
1361
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::PluginBundle::Easy'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has fake => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => 'Bool', |
18
|
|
|
|
|
|
|
lazy => 1, |
19
|
|
|
|
|
|
|
default => sub { |
20
|
|
|
|
|
|
|
return 1 if exists $ENV{FAKE}; |
21
|
|
|
|
|
|
|
( defined $_[0]->payload->{fake} and $_[0]->payload->{fake} == 1 ) |
22
|
|
|
|
|
|
|
? 1 |
23
|
|
|
|
|
|
|
: 0; |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has version => ( |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
isa => 'Str', |
30
|
|
|
|
|
|
|
lazy => 1, |
31
|
|
|
|
|
|
|
default => sub { return ( $_[0]->payload->{version} or 'none' ) }, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has _version_types => ( |
35
|
|
|
|
|
|
|
is => 'ro', |
36
|
|
|
|
|
|
|
isa => 'HashRef[CodeRef]', |
37
|
|
|
|
|
|
|
lazy => 1, |
38
|
|
|
|
|
|
|
builder => '_build_version_types', |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _build_version_types { |
42
|
0
|
|
|
0
|
|
|
my $self = shift; |
43
|
|
|
|
|
|
|
return { |
44
|
|
|
|
0
|
|
|
'none' => sub { }, |
45
|
0
|
|
|
0
|
|
|
'auto' => sub { $self->add_plugins('AutoVersion') }, |
46
|
0
|
|
|
0
|
|
|
'gitnext' => sub { $self->add_plugins('Git::NextVersion') }, |
47
|
0
|
|
|
0
|
|
|
'module' => sub { $self->add_plugins('VersionFromMainModule') }, |
48
|
0
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub _add_version { |
52
|
0
|
|
|
0
|
|
|
my $self = shift; |
53
|
0
|
|
|
|
|
|
my $spec = $self->version; |
54
|
0
|
0
|
|
|
|
|
return unless exists $self->_version_types->{$spec}; |
55
|
0
|
|
|
|
|
|
$self->_version_types->{$spec}->(); |
56
|
0
|
|
|
|
|
|
return; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
has auto_prereqs => ( |
60
|
|
|
|
|
|
|
is => 'ro', |
61
|
|
|
|
|
|
|
isa => 'Bool', |
62
|
|
|
|
|
|
|
lazy => 1, |
63
|
|
|
|
|
|
|
default => 1, |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
has use_no404 => ( |
67
|
|
|
|
|
|
|
is => 'ro', |
68
|
|
|
|
|
|
|
isa => 'Bool', |
69
|
|
|
|
|
|
|
lazy => 1, |
70
|
|
|
|
|
|
|
default => sub { |
71
|
|
|
|
|
|
|
( defined $_[0]->payload->{use_no404} |
72
|
|
|
|
|
|
|
and $_[0]->payload->{use_no404} == 1 ) ? 1 : 0; |
73
|
|
|
|
|
|
|
}, |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
has git => ( |
77
|
|
|
|
|
|
|
is => 'ro', |
78
|
|
|
|
|
|
|
isa => 'Bool', |
79
|
|
|
|
|
|
|
lazy => 1, |
80
|
|
|
|
|
|
|
default => sub { |
81
|
|
|
|
|
|
|
( defined $_[0]->payload->{git} and $_[0]->payload->{git} == 0 ) |
82
|
|
|
|
|
|
|
? 0 |
83
|
|
|
|
|
|
|
: 1; |
84
|
|
|
|
|
|
|
}, |
85
|
|
|
|
|
|
|
); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
has github => ( |
88
|
|
|
|
|
|
|
is => 'ro', |
89
|
|
|
|
|
|
|
isa => 'Bool', |
90
|
|
|
|
|
|
|
lazy => 1, |
91
|
|
|
|
|
|
|
default => sub { |
92
|
|
|
|
|
|
|
return 0 unless $_[0]->git; |
93
|
|
|
|
|
|
|
( defined $_[0]->payload->{github} and $_[0]->payload->{github} == 0 ) |
94
|
|
|
|
|
|
|
? 0 |
95
|
|
|
|
|
|
|
: 1; |
96
|
|
|
|
|
|
|
}, |
97
|
|
|
|
|
|
|
); |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
has github_issues => ( |
100
|
|
|
|
|
|
|
is => 'ro', |
101
|
|
|
|
|
|
|
isa => 'Bool', |
102
|
|
|
|
|
|
|
lazy => 1, |
103
|
|
|
|
|
|
|
default => sub { |
104
|
|
|
|
|
|
|
return 0 unless $_[0]->github; |
105
|
|
|
|
|
|
|
( defined $_[0]->payload->{github_issues} |
106
|
|
|
|
|
|
|
and $_[0]->payload->{github_issues} == 0 ) |
107
|
|
|
|
|
|
|
? 0 |
108
|
|
|
|
|
|
|
: 1; |
109
|
|
|
|
|
|
|
}, |
110
|
|
|
|
|
|
|
); |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
has task_weaver => ( |
113
|
|
|
|
|
|
|
is => 'ro', |
114
|
|
|
|
|
|
|
isa => 'Bool', |
115
|
|
|
|
|
|
|
lazy => 1, |
116
|
|
|
|
|
|
|
default => sub { |
117
|
|
|
|
|
|
|
( defined $_[0]->payload->{task_weaver} |
118
|
|
|
|
|
|
|
and $_[0]->payload->{task_weaver} == 1 ) ? 1 : 0; |
119
|
|
|
|
|
|
|
}, |
120
|
|
|
|
|
|
|
); |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
has signature => ( |
123
|
|
|
|
|
|
|
is => 'ro', |
124
|
|
|
|
|
|
|
isa => 'Bool', |
125
|
|
|
|
|
|
|
lazy => 1, |
126
|
|
|
|
|
|
|
default => sub { |
127
|
|
|
|
|
|
|
( defined $_[0]->payload->{signature} |
128
|
|
|
|
|
|
|
and $_[0]->payload->{signature} == 0 ) ? 0 : 1; |
129
|
|
|
|
|
|
|
}, |
130
|
|
|
|
|
|
|
); |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
has report => ( |
133
|
|
|
|
|
|
|
is => 'ro', |
134
|
|
|
|
|
|
|
isa => 'Bool', |
135
|
|
|
|
|
|
|
lazy => 1, |
136
|
|
|
|
|
|
|
default => sub { |
137
|
|
|
|
|
|
|
( defined $_[0]->payload->{report} and $_[0]->payload->{report} == 1 ) |
138
|
|
|
|
|
|
|
? 1 |
139
|
|
|
|
|
|
|
: 0; |
140
|
|
|
|
|
|
|
}, |
141
|
|
|
|
|
|
|
); |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub configure { |
144
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
# Basic sans upload |
147
|
0
|
|
|
|
|
|
$self->add_plugins( |
148
|
|
|
|
|
|
|
'GatherDir', 'PruneCruft', 'ManifestSkip', 'MetaYAML', |
149
|
|
|
|
|
|
|
'License', 'ExecDir', 'ShareDir', 'MakeMaker', |
150
|
|
|
|
|
|
|
'Manifest', 'TestRelease', 'ConfirmRelease', |
151
|
|
|
|
|
|
|
); |
152
|
0
|
0
|
|
|
|
|
$self->fake |
153
|
|
|
|
|
|
|
? $self->add_plugins('FakeRelease') |
154
|
|
|
|
|
|
|
: $self->add_plugins('UploadToCPAN'); |
155
|
|
|
|
|
|
|
|
156
|
0
|
|
|
|
|
|
$self->_add_version(); |
157
|
|
|
|
|
|
|
|
158
|
0
|
0
|
|
|
|
|
$self->add_plugins('OurPkgVersion') unless $self->version eq 'module'; |
159
|
0
|
|
|
|
|
|
$self->add_plugins( |
160
|
|
|
|
|
|
|
'MetaJSON', |
161
|
|
|
|
|
|
|
'ReadmeFromPod', |
162
|
|
|
|
|
|
|
'InstallGuide', |
163
|
|
|
|
|
|
|
'PerlTidy', |
164
|
|
|
|
|
|
|
[ |
165
|
|
|
|
|
|
|
'GitFmtChanges' => { |
166
|
|
|
|
|
|
|
max_age => 365, |
167
|
|
|
|
|
|
|
tag_regexp => q{^.*$}, |
168
|
|
|
|
|
|
|
file_name => q{Changes}, |
169
|
|
|
|
|
|
|
log_format => q{short}, |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
], |
172
|
|
|
|
|
|
|
); |
173
|
|
|
|
|
|
|
|
174
|
0
|
0
|
|
|
|
|
$self->add_plugins( |
175
|
|
|
|
|
|
|
[ |
176
|
|
|
|
|
|
|
'GithubMeta' => { |
177
|
|
|
|
|
|
|
issues => $self->github_issues, |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
] |
180
|
|
|
|
|
|
|
) if $self->github; |
181
|
0
|
0
|
|
|
|
|
$self->add_plugins('AutoPrereqs') if $self->auto_prereqs; |
182
|
|
|
|
|
|
|
|
183
|
0
|
0
|
|
|
|
|
if ( $self->task_weaver ) { |
184
|
0
|
|
|
|
|
|
$self->add_plugins('TaskWeaver'); |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
else { |
187
|
0
|
|
|
|
|
|
$self->add_plugins( 'ReportVersions::Tiny', |
188
|
|
|
|
|
|
|
[ 'PodWeaver' => { config_plugin => '@Author::RUSSOZ' }, ], |
189
|
|
|
|
|
|
|
); |
190
|
|
|
|
|
|
|
|
191
|
0
|
|
|
|
|
|
$self->add_plugins('Test::UseAllModules'); |
192
|
0
|
|
|
|
|
|
$self->add_bundle( 'TestingMania' => |
193
|
|
|
|
|
|
|
{ disable => [ 'Test::CPAN::Changes', 'Test::Synopsis', ], } ); |
194
|
|
|
|
|
|
|
$self->add_plugins('Test::Pod::No404s') |
195
|
0
|
0
|
0
|
|
|
|
if ( $self->use_no404 || $ENV{NO404} ); |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
0
|
0
|
|
|
|
|
$self->add_plugins('Signature') if $self->signature; |
199
|
0
|
0
|
|
|
|
|
$self->add_plugins('ReportPhase') if $self->report; |
200
|
0
|
0
|
|
|
|
|
$self->add_bundle('Git') if $self->git; |
201
|
|
|
|
|
|
|
|
202
|
0
|
|
|
|
|
|
$self->add_plugins('Git::Contributors'); |
203
|
|
|
|
|
|
|
|
204
|
0
|
|
|
|
|
|
$self->add_plugins('ExtraTests'); |
205
|
|
|
|
|
|
|
|
206
|
0
|
|
|
|
|
|
return; |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
210
|
1
|
|
|
1
|
|
753
|
no Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
1; |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
__END__ |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=pod |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=encoding UTF-8 |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=head1 NAME |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
Dist::Zilla::PluginBundle::Author::RUSSOZ - configure Dist::Zilla like RUSSOZ |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=head1 VERSION |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
version 0.025 |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=head1 SYNOPSIS |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
# in dist.ini |
231
|
|
|
|
|
|
|
[@Author::RUSSOZ] |
232
|
|
|
|
|
|
|
; fake = 0 |
233
|
|
|
|
|
|
|
; version = none | auto | gitnext |
234
|
|
|
|
|
|
|
; auto_prereqs = 1 |
235
|
|
|
|
|
|
|
; github = 1 |
236
|
|
|
|
|
|
|
; use_no404 = 0 |
237
|
|
|
|
|
|
|
; task_weaver = 0 |
238
|
|
|
|
|
|
|
; signature = 1 |
239
|
|
|
|
|
|
|
; report = 0 |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=head1 DESCRIPTION |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
C<Dist::Zilla::PluginBundle::Author::RUSSOZ> provides shorthand for |
244
|
|
|
|
|
|
|
a L<Dist::Zilla> configuration approximately like: |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
[@Basic] |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
[MetaJSON] |
249
|
|
|
|
|
|
|
[ReadmeFromPod] |
250
|
|
|
|
|
|
|
[InstallGuide] |
251
|
|
|
|
|
|
|
[GitFmtChanges] |
252
|
|
|
|
|
|
|
max_age = 365 |
253
|
|
|
|
|
|
|
tag_regexp = ^.*$ |
254
|
|
|
|
|
|
|
file_name = Changes |
255
|
|
|
|
|
|
|
log_format = short |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
[OurPkgVersion] |
258
|
|
|
|
|
|
|
[GithubMeta] ; if github = 1 |
259
|
|
|
|
|
|
|
[AutoPrereqs] ; unless auto_prereqs = 0 |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
[ReportVersions::Tiny] |
262
|
|
|
|
|
|
|
[PodWeaver] |
263
|
|
|
|
|
|
|
config_plugin = @Author::RUSSOZ |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
; if task_weaver =1 |
266
|
|
|
|
|
|
|
[TaskWeaver] |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
; else (task_weaver = 0) |
269
|
|
|
|
|
|
|
[@TestingMania] |
270
|
|
|
|
|
|
|
disable = Test::CPAN::Changes, SynopsisTests |
271
|
|
|
|
|
|
|
; [Test::Pod::No404] |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
; endif |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
[Signature] ; if signature = 1 |
276
|
|
|
|
|
|
|
[ReportPhase] ; if report = 1 |
277
|
|
|
|
|
|
|
[@Git] |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=head1 NAME |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
Dist::Zilla::PluginBundle::Author::RUSSOZ - configure Dist::Zilla like RUSSOZ |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=head1 VERSION |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
version 0.025 |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=head1 TASK CONTENTS |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=head1 USAGE |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Just put C<[@Author::RUSSOZ]> in your F<dist.ini>. You can supply the following |
292
|
|
|
|
|
|
|
options: |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=for :list * version |
295
|
|
|
|
|
|
|
How to handle version numbering. Possible values: none, |
296
|
|
|
|
|
|
|
auto (will use L<Dist::Zilla::Plugin::AutoVersion>), |
297
|
|
|
|
|
|
|
gitnext (will use Dist::Zilla::Plugin::Git::NextVersion). |
298
|
|
|
|
|
|
|
Default = none. |
299
|
|
|
|
|
|
|
* auto_prereqs |
300
|
|
|
|
|
|
|
Whether the module will use C<AutoPrereqs> or not. Default = 1. |
301
|
|
|
|
|
|
|
* github |
302
|
|
|
|
|
|
|
If using github, enable C<[GithubMeta]>. Default = 1. |
303
|
|
|
|
|
|
|
* use_no404 |
304
|
|
|
|
|
|
|
Whether to use C<[Test::Pod::No404]> in the distribution. Default = 0. |
305
|
|
|
|
|
|
|
* task_weaver |
306
|
|
|
|
|
|
|
Set to 1 if this is a C<Task::> distribution. It will enable C<[TaskWeaver]> |
307
|
|
|
|
|
|
|
while disabling C<[PodWeaver]> and all release tests. Default = 0. |
308
|
|
|
|
|
|
|
* fake |
309
|
|
|
|
|
|
|
Set to 1 if this is a fake release. It will disable [UploadToCPAN] and |
310
|
|
|
|
|
|
|
enable [FakeRelease]. It can also be enabled by setting the environemnt |
311
|
|
|
|
|
|
|
variable C<FAKE>. Default = 0. |
312
|
|
|
|
|
|
|
* signature |
313
|
|
|
|
|
|
|
Whether to GPG sign the module or not. Default = 1. |
314
|
|
|
|
|
|
|
* report |
315
|
|
|
|
|
|
|
Whether to report the Dist::Zilla building phases. Default = 0. |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=for Pod::Coverage configure |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=head1 SEE ALSO |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
C<< L<Dist::Zilla> >> |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=head1 ACKNOWLEDGMENTS |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
Much of the first implementation was shamelessly copied from |
326
|
|
|
|
|
|
|
C<Dist::Zilla::PluginBundle::Author::DOHERTY>. |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head1 AUTHOR |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
Alexei Znamensky <russoz@cpan.org> |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
This software is copyright (c) 2011 - 2017 by Alexei Znamensky. |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
337
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
=head1 AUTHOR |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
Alexei Znamensky <russoz@cpan.org> |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
This software is copyright (c) 2011 - 2017 by Alexei Znamensky. |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
348
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=cut |