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.037;
2             # ABSTRACT: fake plugin to test release
3              
4 7     7   6782 use Moose;
  7         231  
  7         74  
5             with 'Dist::Zilla::Role::Releaser';
6              
7 7     7   55243 use Dist::Zilla::Pragmas;
  7         17  
  7         65  
8              
9 7     7   53 use namespace::autoclean;
  7         15  
  7         100  
10              
11             has user => (
12             is => 'ro',
13             isa => 'Str',
14             required => 1,
15             default => 'AUTHORID',
16             );
17              
18 1     1 0 61 sub cpanid { shift->user }
19              
20             sub release {
21 13     13 0 638 my $self = shift;
22              
23 13         68 for my $env (
24             'DIST_ZILLA_FAKERELEASE_FAIL', # old
25             'DZIL_FAKERELEASE_FAIL', # new
26             ) {
27 26 100       129 $self->log_fatal("$env set, aborting") if $ENV{$env};
28             }
29              
30 11         105 $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.037
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
107             released in the last two to three years. (That is, if the most recently
108             released version is v5.40, then this module should work on both v5.40 and
109             v5.38.)
110              
111             Although it may work on older versions of perl, no guarantee is made that the
112             minimum required version will not be increased. The version may be increased
113             for any reason, and there is no promise that patches will be accepted to
114             lower the minimum required perl.
115              
116             =head1 SEE ALSO
117              
118             Core Dist::Zilla plugins:
119             L<ConfirmRelease|Dist::Zilla::Plugin::ConfirmRelease>,
120             L<UploadToCPAN|Dist::Zilla::Plugin::UploadToCPAN>.
121              
122             =head1 AUTHOR
123              
124             Ricardo SIGNES 😏 <cpan@semiotic.systems>
125              
126             =head1 COPYRIGHT AND LICENSE
127              
128             This software is copyright (c) 2026 by Ricardo SIGNES.
129              
130             This is free software; you can redistribute it and/or modify it under
131             the same terms as the Perl 5 programming language system itself.
132              
133             =cut