File Coverage

blib/lib/Dist/Zilla/Plugin/BlockRelease.pm
Criterion Covered Total %
statement 16 17 94.1
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 3 0.0
total 22 27 81.4


line stmt bran cond sub pod time code
1 1     1   614056 use strict;
  1         2  
  1         40  
2 1     1   4 use warnings;
  1         1  
  1         44  
3             package Dist::Zilla::Plugin::BlockRelease;
4             # git description: v0.001-8-gc4f0ca1
5             $Dist::Zilla::Plugin::BlockRelease::VERSION = '0.002';
6             # ABSTRACT: Prevent a release from occurring
7             # KEYWORDS: plugin distribution release sanity safety prevent
8             # vim: set ts=8 sw=4 tw=78 et :
9              
10 1     1   4 use Moose;
  1         1  
  1         7  
11             with 'Dist::Zilla::Role::BeforeRelease',
12             'Dist::Zilla::Role::Releaser';
13              
14 1     1   4841 use namespace::autoclean;
  1         2  
  1         9  
15              
16             sub BUILD
17             {
18 1     1 0 1 my $self = shift;
19 1         4 $self->log('releases will be prevented!');
20             }
21              
22             # nothing to put in dump_config yet...
23             # around dump_config => sub { ... };
24              
25             sub before_release
26             {
27 1     1 0 168469 my $self = shift;
28 1         14 $self->log_fatal('halting release');
29             }
30              
31 0     0 0   sub release {}
32              
33             __PACKAGE__->meta->make_immutable;
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Dist::Zilla::Plugin::BlockRelease - Prevent a release from occurring
44              
45             =head1 VERSION
46              
47             version 0.002
48              
49             =head1 SYNOPSIS
50              
51             In your F<dist.ini>:
52              
53             [BlockRelease]
54              
55             =head1 DESCRIPTION
56              
57             This plugin, when loaded, prevents C<dzil release> from completing. It is
58             useful to include temporarily, while developing (perhaps while using some
59             development-only requirements or code, to guard against an accidental release.
60              
61             Load it last to allow all other C<BeforeRelease> plugins to still perform
62             their checks, or first to stop these pre-release checks from occurring.
63              
64             =for Pod::Coverage BUILD before_release release
65              
66             =head1 SUPPORT
67              
68             =for stopwords irc
69              
70             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-BlockRelease>
71             (or L<bug-Dist-Zilla-Plugin-BlockRelease@rt.cpan.org|mailto:bug-Dist-Zilla-Plugin-BlockRelease@rt.cpan.org>).
72             I am also usually active on irc, as 'ether' at C<irc.perl.org>.
73              
74             =head1 AUTHOR
75              
76             Karen Etheridge <ether@cpan.org>
77              
78             =head1 COPYRIGHT AND LICENSE
79              
80             This software is copyright (c) 2014 by Karen Etheridge.
81              
82             This is free software; you can redistribute it and/or modify it under
83             the same terms as the Perl 5 programming language system itself.
84              
85             =cut