Dist/Zilla/PluginBundle/RSRCHBOY.pm

filter: Statementstmt 52.8% 47 / 89 Branchbran 0.0% 0 / 24 Conditioncond 0.0% 0 / 14 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 36.6% 11 / 30 Podpod 100% 5 / 5 totaltotal 37.2% 63 / 169 CC 20 SCAR 25.0
CC
20
Cov
37%
release_plugins
56.0
meta_provider_plugins
12.0
configure
12.0
CRAP 12.1
↑ Summary Pod/Weaver/Section/RSRCHBOY/Authors.pm »
1 #
2 # This file is part of Dist-Zilla-PluginBundle-RSRCHBOY
3 #
4 # This software is Copyright (c) 2026 by Chris Weyl.
5 #
6 # This is free software, licensed under:
7 #
8 # The GNU Lesser General Public License, Version 2.1, February 1999
9 #
10 package Dist::Zilla::PluginBundle::RSRCHBOY;
11 2 our $AUTHORITY = 'cpan:RSRCHBOY';
12 # git description: 0.079-4-ga98733b
13 2 $Dist::Zilla::PluginBundle::RSRCHBOY::VERSION = '0.080';
14  
15 # ABSTRACT: Zilla your distributions like RSRCHBOY!
16  
17 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use MooseX::AttributeShortcuts;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 ▶use autodie 0.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use autobox::Core;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 2 ▶use Dist::Zilla;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 2 with
30 'Dist::Zilla::Role::PluginBundle::Easy',
31 'Dist::Zilla::Role::PluginBundle::PluginRemover' => { -version => '0.102' },
32 'Dist::Zilla::Role::PluginBundle::Config::Slicer',
33 ;
34  
35 2 ▶use Config::MVP::Slicer 0.302;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 2 ▶use Path::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 0 ▶has github_user => (is => 'lazy', isa => 'Str', builder => sub { 'rsrchboy' });
Subroutine __ANON__: not called CC=1 SCAR=1.2
39 0 ▶has set_github_user => (is => 'lazy', isa => 'Str', builder => sub { 1 } );
Subroutine _build_set_github_user: not called CC=1 SCAR=1.2
40  
41 # FIXME this next section is kinda... ugly
42  
43 2 has is_app => (is => 'lazy', isa => 'Bool');
44 2 has is_private => (is => 'lazy', isa => 'Bool');
45  
46 0 ▶sub _build_is_app { $_[0]->payload->{cat_app} || $_[0]->payload->{app} }
Subroutine _build_is_app: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_[0]->payload->{"cat_app"} or $_[0]->payload->{"app"} 0 0 0
47 0 ▶sub _build_is_private { $_[0]->payload->{private} }
Subroutine _build_is_private: not called CC=1 SCAR=6.9
48  
49 has sign => (
50 traits => ['Bool'],
51 is => 'lazy',
52 isa => 'Bool',
53 0 ▶ builder => sub { shift->payload->{sign} // 0 },
Subroutine _build_sign: not called CC=2 SCAR=17.9
Condition0%0/2
+(shift())->payload->{"sign"} // 0
l!l
00
MC/DC0%0/1
+(shift())->payload->{"sign"} // 0
+(shift())->payload->{"sign"}
Truth table0%0/2
A
A= +(shift())->payload->{"sign"}
Aresult
11
00
54 2 handles => { "no_sign" => 'not' },
55 );
56  
57 has tweet => (
58 traits => ['Bool'],
59 is => 'lazy',
60 isa => 'Bool',
61 0 ▶ builder => sub { shift->payload->{tweet} // 0 },
Subroutine _build_tweet: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=2 SCAR=17.9
Condition0%0/4
+(shift())->payload->{"tweet"} // 0
l!l
00
+(shift())->payload->{"tweet"} // 0
l!l
00
MC/DC0%0/1
+(shift())->payload->{"tweet"} // 0
+(shift())->payload->{"tweet"}
MC/DC0%0/1
+(shift())->payload->{"tweet"} // 0
+(shift())->payload->{"tweet"}
Truth table0%0/2
A
A= +(shift())->payload->{"tweet"}
Aresult
11
00
Truth table0%0/2
A
A= +(shift())->payload->{"tweet"}
Aresult
11
00
62 2 handles => { "no_tweet" => 'not' },
63 );
64  
65 has github => (
66 traits => ['Bool'],
67 is => 'lazy',
68 isa => 'Bool',
69 0 ▶ builder => sub { shift->payload->{github} // 1 },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine _build_github: not called CC=2 SCAR=17.9
Condition0%0/4
+(shift())->payload->{"github"} // 1
l!l
00
+(shift())->payload->{"github"} // 1
l!l
00
MC/DC0%0/1
+(shift())->payload->{"github"} // 1
+(shift())->payload->{"github"}
MC/DC0%0/1
+(shift())->payload->{"github"} // 1
+(shift())->payload->{"github"}
Truth table0%0/2
A
A= +(shift())->payload->{"github"}
Aresult
11
00
Truth table0%0/2
A
A= +(shift())->payload->{"github"}
Aresult
11
00
70 2 handles => { "no_github" => 'not' },
71 );
72  
73 has install_on_release => (
74 traits => ['Bool'],
75 is => 'lazy',
76 isa => 'Bool',
77 0 ▶ builder => sub { shift->payload->{install_on_release} // 1 },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine _build_install_on_release: not called CC=2 SCAR=17.9
Condition0%0/4
+(shift())->payload->{"install_on_release"} // 1
l!l
00
+(shift())->payload->{"install_on_release"} // 1
l!l
00
MC/DC0%0/1
+(shift())->payload->{"install_on_release"} // 1
+(shift())->payload->{"install_on_release"}
MC/DC0%0/1
+(shift())->payload->{"install_on_release"} // 1
+(shift())->payload->{"install_on_release"}
Truth table0%0/2
A
A= +(shift())->payload->{"install_on_release"}
Aresult
11
00
Truth table0%0/2
A
A= +(shift())->payload->{"install_on_release"}
Aresult
11
00
78 2 handles => { "no_install_on_release" => 'not' },
79 );
80  
81 has is_task => (
82 traits => ['Bool'],
83 is => 'lazy',
84 isa => 'Bool',
85 0 ▶ builder => sub { shift->payload->{task} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine _build_is_task: not called CC=1 SCAR=6.9
86 2 handles => { is_not_task => 'not' },
87 );
88  
89 has _copy_from_build => (
90 is => 'lazy',
91 isa => 'ArrayRef[Str]',
92 0 ▶ builder => sub {
Subroutine _build__copy_from_build: not called CC=2 SCAR=17.9
93 0 my ($self) = @_;
94  
95 0 my @copy = (qw{ LICENSE });
96 0 ▶ push @copy, 'Makefile.PL'
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_app 0 0 0
97 if $self->is_app;
98  
99 0 return [ @copy ];
100 },
101 2 );
102  
103  
104 0 ▶sub release_plugins {
Subroutine release_plugins: not called CC=7 SCAR=40.3
Pod documented
105 0 my $self = shift @_;
106  
107 0 my @allow_dirty = qw{
108 .gitignore
109 Changes
110 README.mkdn
111 dist.ini
112 weaver.ini
113 };
114 0 push @allow_dirty, $self->_copy_from_build->flatten;
115  
116  
117 my @plugins = (
118 qw{
119 TestRelease
120 CheckChangesHasContent
121 CheckPrereqsIndexed
122 },
123 [ 'Git::Remote::Update' => GitFetchOrigin => {
124 remote_name => 'origin',
125 do_update => 1,
126 } ],
127 [ 'Git::Remote::Check' => GitCheckReleaseBranchSync => {
128 remote_name => 'origin',
129 do_update => 0,
130 branch => 'release/cpan',
131 remote_branch => 'release/cpan',
132 } ],
133 [ 'Git::Remote::Check' => GitCheckMasterBranchSync => {
134 remote_name => 'origin',
135 do_update => 0,
136 branch => 'master',
137 remote_branch => 'master',
138 } ],
139 [ 'Git::Check' => { allow_dirty => [ @allow_dirty ] } ],
140 [ 'Git::Commit' => { allow_dirty => [ @allow_dirty ] } ],
141  
142 [ 'Test::CheckDeps' => { ':version' => '0.007', fatal => 1, level => 'suggests' } ],
143 'CheckSelfDependency',
144 'SchwartzRatio',
145  
146 [ 'Git::Tag' => { tag_format => '%v', signed => $self->sign } ],
147  
148 0 ▶ $ENV{CI} ? () : (
Branch: 6 branches
BranchTrueFalseTotal
$ENV{'CI'} ? : 0 0 0
$self->no_tweet ? : 0 0 0
$self->is_private ? : 0 0 0
$self->no_sign ? : 0 0 0
$self->no_install_on_release ? : 0 0 0
$self->no_github ? : 0 0 0
149 [ 'Git::CommitBuild' => 'Git::CommitBuild::Build' => { } ],
150 [ 'Git::CommitBuild' => 'Git::CommitBuild::Release' => {
151 release_branch => 'release/cpan',
152 release_message => 'Full build of CPAN release %v%t',
153 multiple_inheritance => 1,
154 }],
155 ),
156  
157 [ 'Git::Push' => {
158 push_to => [
159 'origin',
160 'origin refs/heads/release/cpan:refs/heads/release/cpan',
161 ],
162 }],
163  
164 $self->no_tweet ? () : [
165 Twitter => {
166 hash_tags => '#perl #cpan',
167 # TODO: remove the next line when resolved:
168 # https://github.com/dagolden/dist-zilla-plugin-twitter/issues/11
169 tweet_url => 'https://metacpan.org/release/{{$AUTHOR_UC}}/{{$DIST}}-{{$VERSION}}{{$TRIAL}}/',
170 },
171 ],
172  
173 $self->is_private ? () : 'UploadToCPAN',
174 $self->no_sign ? () : 'Signature',
175 $self->no_install_on_release ? () : [ InstallRelease => { install_command => 'cpanm .' } ],
176 $self->no_github ? () : [ 'GitHub::Update' => { metacpan => 1 } ],
177  
178 [ 'Run::AfterRelease' => { run => 'mkdir -p releases ; mv %s releases/' } ],
179  
180 'ConfirmRelease',
181 );
182  
183 0 return @plugins;
184 }
185  
186  
187 0 ▶sub author_tests {
Subroutine author_tests: not called CC=1 SCAR=6.9
Pod documented
188 0 my ($self) = @_;
189  
190 return (
191 0 [ 'Test::PodSpelling' => { stopwords => [ $self->stopwords ] } ],
192 qw{
193 ConsistentVersionTest
194 PodCoverageTests
195 PodSyntaxTests
196 Test::NoTabs
197 Test::EOL
198 HasVersionTests
199 Test::Compile
200 NoSmartCommentsTests
201 Test::Pod::LinkCheck
202 RunExtraTests
203 },
204 [ 'Test::MinimumVersion' => { max_target_perl => '5.020000' } ],
205 );
206 }
207  
208  
209 0 ▶sub meta_provider_plugins {
Subroutine meta_provider_plugins: not called CC=3 SCAR=24.8
Pod documented
210 0 my ($self) = @_;
211  
212 0 my @plugins = (
213 [ Authority => { authority => 'cpan:RSRCHBOY' } ],
214 qw{ MetaConfig MetaJSON MetaYAML },
215 [ MetaNoIndex => { directory => [ qw{ corpus t } ] } ],
216 'MetaProvides::Package',
217  
218 'MetaData::BuiltWith',
219 );
220  
221 0 ▶ if ($self->github) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->github) 0 0 0
222  
223 0 my $opts = { issues => 1 };
224  
225 0 ▶ $opts->{user} = $self->github_user
Branch: 1 branch
BranchTrueFalseTotal
if $self->set_github_user 0 0 0
226 if $self->set_github_user;
227  
228 0 push @plugins, [ GithubMeta => $opts ]
229 }
230  
231 0 return @plugins;
232 }
233  
234  
235 0 ▶sub configure {
Subroutine configure: not called CC=3 SCAR=24.8
Pod documented
236 0 my $self = shift @_;
237  
238 0 my $autoprereq_opts = $self->config_slice({ autoprereqs_skip => 'skip' });
239 0 my $prepender_opts = $self->config_slice({ prepender_skip => 'skip' });
240  
241 # if we have a weaver.ini, use that; otherwise use our bundle
242 0 ▶ my $podweaver
Branch: 1 branch
BranchTrueFalseTotal
file('weaver.ini')->stat ? : 0 0 0
243 = file('weaver.ini')->stat
244 ? 'PodWeaver'
245 : [ PodWeaver => { config_plugin => '@RSRCHBOY' } ]
246 ;
247  
248 0 $self->add_plugins(
249 [ NextRelease => { format => '%-8V %{yyyy-MM-dd HH:mm:ss ZZZZ}d' }],
250 );
251  
252 0 $self->add_plugins([ 'Git::NextVersion' =>
253 #;first_version = 0.001 ; this is the default
254 #;version_regexp = ^v(.+)$ ; this is the default
255 { version_regexp => '^(\d.\d+(_\d\d)?)(-TRIAL|)$' },
256 ]);
257  
258 0 $self->add_plugins(qw{
259 CopyrightYearFromGit
260 ContributorsFromGit
261 });
262  
263 0 $self->add_bundle('Git::CheckFor');
264  
265 0 ▶ $self->add_plugins(
Branch: 1 branch
BranchTrueFalseTotal
$self->is_task ? : 0 0 0
266 [ 'Git::GatherDir' => { exclude_filename => $self->_copy_from_build } ],
267 [
268 PromptIfStale => {
269 phase => 'build',
270 modules => [ qw{
271 Dist::Zilla
272 Dist::Zilla::PluginBundle::RSRCHBOY
273 }],
274 },
275 ],
276  
277 qw{
278 PruneCruft
279 Git::Describe
280 ExecDir
281 ShareDir
282 MakeMaker
283 Manifest
284 SurgicalPkgVersion
285 MinimumPerl
286 Test::ReportPrereqs
287 },
288 [ AutoPrereqs => $autoprereq_opts ],
289 [ Prepender => $prepender_opts ],
290  
291 # These are requirements that will be inserted on the generated dist,
292 # that indicate that for develop phase (e.g. author/release testing)
293 # certain additional packages are required for full exercise of xt/
294 [ Prereqs => AuthorBundleDevelopRequires => {
295 -phase => 'develop',
296 -relationship => 'requires',
297  
298 # TODO: drop when this is merged and released:
299 # https://github.com/marcel-maint/Dist-Zilla-Plugin-HasVersionTests/pull/2
300 'Test::HasVersion' => 0,
301  
302 # TODO: drop when this is merged and released:
303 # https://github.com/doherty/Dist-Zilla-Plugin-Test-MinimumVersion/pull/7
304 'Test::MinimumVersion' => 0,
305  
306 'Test::ConsistentVersion' => 0,
307 } ],
308  
309 $self->author_tests,
310 $self->meta_provider_plugins,
311 $self->release_plugins,
312  
313 'License',
314 'CPANFile',
315  
316 [ ReadmeAnyFromPod => ReadmeMarkdownInRoot => {
317 type => 'markdown',
318 filename => 'README.mkdn',
319 location => 'root',
320 }],
321 [ ReadmeAnyFromPod => ReadmeTxt => {
322 type => 'text',
323 filename => 'README',
324 }],
325 [ CopyFilesFromBuild => { copy => $self->_copy_from_build } ],
326  
327 [ 'GitHubREADME::Badge' => { badges => [ qw{
328 github_actions/dzil-matrix.yaml
329 cpants
330 } ] } ],
331  
332 ($self->is_task ? 'TaskWeaver' : $podweaver),
333 );
334  
335 0 return;
336 }
337  
338  
339 0 ▶sub stopwords {
Subroutine stopwords: not called CC=1 SCAR=6.9
Pod documented
340  
341 0 return qw{
342 ABEND
343 AFAICT
344 Formattable
345 Gratipay
346 PayPal
347 RSRCHBOY
348 RSRCHBOY's
349 codebase
350 coderef
351 formattable
352 gpg
353 implementers
354 ini
355 metaclass
356 metaclasses
357 parameterization
358 parameterized
359 subclasses
360 };
361 }
362  
363 2 __PACKAGE__->meta->make_immutable;
364 2 !!42;
365  
366 __END__
↑ Summary Pod/Weaver/Section/RSRCHBOY/Authors.pm »