File Coverage

blib/lib/Dist/Zilla/Plugin/FakeRelease.pm
Criterion Covered Total %
statement 14 14 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 21 23 91.3


line stmt bran cond sub pod time code
1             package Dist::Zilla::Plugin::FakeRelease 6.029;
2             # ABSTRACT: fake plugin to test release
3              
4 7     7   5882 use Moose;
  7         24  
  7         70  
5             with 'Dist::Zilla::Role::Releaser';
6              
7 7     7   50599 use Dist::Zilla::Pragmas;
  7         21  
  7         64  
8              
9 7     7   56 use namespace::autoclean;
  7         28  
  7         63  
10              
11             has user => (
12             is => 'ro',
13             isa => 'Str',
14             required => 1,
15             default => 'AUTHORID',
16             );
17              
18 1     1 0 37 sub cpanid { shift->user }
19              
20             sub release {
21 13     13 0 632 my $self = shift;
22              
23 13         164 for my $env (
24             'DIST_ZILLA_FAKERELEASE_FAIL', # old
25             'DZIL_FAKERELEASE_FAIL', # new
26             ) {
27 26 100       307 $self->log_fatal("$env set, aborting") if $ENV{$env};
28             }
29              
30 11         277 $self->log('Fake release happening (nothing was really done)');
31             }
32              
33             __PACKAGE__->meta->make_immutable;
34             1;
35              
36             #pod =head1 SYNOPSIS
37             #pod
38             #pod [FakeRelease]
39             #pod user = CPANAUTHORID ; # optional.
40             #pod
41             #pod =head1 DESCRIPTION
42             #pod
43             #pod This plugin is a L<Releaser|Dist::Zilla::Role::Releaser> that does nothing. It
44             #pod is directed to plugin authors, who may need a dumb release plugin to test their
45             #pod shiny plugin implementing L<BeforeRelease|Dist::Zilla::Role::BeforeRelease>
46             #pod and L<AfterRelease|Dist::Zilla::Role::AfterRelease>.
47             #pod
48             #pod When this plugin does the release, it will just log a message and finish.
49             #pod
50             #pod If you set the environment variable C<DZIL_FAKERELEASE_FAIL> to a true value,
51             #pod the plugin will die instead of doing nothing. This can be useful for
52             #pod authors wanting to test reliably that release failed.
53             #pod
54             #pod You can optionally provide the 'user' parameter, which defaults to 'AUTHORID',
55             #pod which will allow things that depend on this metadata
56             #pod ( Sometimes provided by L<UploadToCPAN|Dist::Zilla::Plugin::UploadToCPAN> ) to still work.
57             #pod ( For example: L<Dist::Zilla::Plugin::Twitter> )
58             #pod
59             #pod =head1 SEE ALSO
60             #pod
61             #pod Core Dist::Zilla plugins:
62             #pod L<ConfirmRelease|Dist::Zilla::Plugin::ConfirmRelease>,
63             #pod L<UploadToCPAN|Dist::Zilla::Plugin::UploadToCPAN>.
64             #pod
65              
66             __END__
67              
68             =pod
69              
70             =encoding UTF-8
71              
72             =head1 NAME
73              
74             Dist::Zilla::Plugin::FakeRelease - fake plugin to test release
75              
76             =head1 VERSION
77              
78             version 6.029
79              
80             =head1 SYNOPSIS
81              
82             [FakeRelease]
83             user = CPANAUTHORID ; # optional.
84              
85             =head1 DESCRIPTION
86              
87             This plugin is a L<Releaser|Dist::Zilla::Role::Releaser> that does nothing. It
88             is directed to plugin authors, who may need a dumb release plugin to test their
89             shiny plugin implementing L<BeforeRelease|Dist::Zilla::Role::BeforeRelease>
90             and L<AfterRelease|Dist::Zilla::Role::AfterRelease>.
91              
92             When this plugin does the release, it will just log a message and finish.
93              
94             If you set the environment variable C<DZIL_FAKERELEASE_FAIL> to a true value,
95             the plugin will die instead of doing nothing. This can be useful for
96             authors wanting to test reliably that release failed.
97              
98             You can optionally provide the 'user' parameter, which defaults to 'AUTHORID',
99             which will allow things that depend on this metadata
100             ( Sometimes provided by L<UploadToCPAN|Dist::Zilla::Plugin::UploadToCPAN> ) to still work.
101             ( For example: L<Dist::Zilla::Plugin::Twitter> )
102              
103             =head1 PERL VERSION
104              
105             This module should work on any version of perl still receiving updates from
106             the Perl 5 Porters. This means it should work on any version of perl released
107             in the last two to three years. (That is, if the most recently released
108             version is v5.40, then this module should work on both v5.40 and v5.38.)
109              
110             Although it may work on older versions of perl, no guarantee is made that the
111             minimum required version will not be increased. The version may be increased
112             for any reason, and there is no promise that patches will be accepted to lower
113             the minimum required perl.
114              
115             =head1 SEE ALSO
116              
117             Core Dist::Zilla plugins:
118             L<ConfirmRelease|Dist::Zilla::Plugin::ConfirmRelease>,
119             L<UploadToCPAN|Dist::Zilla::Plugin::UploadToCPAN>.
120              
121             =head1 AUTHOR
122              
123             Ricardo SIGNES 😏 <cpan@semiotic.systems>
124              
125             =head1 COPYRIGHT AND LICENSE
126              
127             This software is copyright (c) 2022 by Ricardo SIGNES.
128              
129             This is free software; you can redistribute it and/or modify it under
130             the same terms as the Perl 5 programming language system itself.
131              
132             =cut