File Coverage

blib/lib/Dist/Zilla/Plugin/Author/VDB/Hg/Status.pm
Criterion Covered Total %
statement 9 16 56.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 23 52.1


line stmt bran cond sub pod time code
1             # ---------------------------------------------------------------------- copyright and license ---
2             #
3             # file: lib/Dist/Zilla/Plugin/Author/VDB/Hg/Status.pm
4             #
5             # Copyright © 2015 Van de Bugger
6             #
7             # This file is part of perl-Dist-Zilla-PluginBundle-Author-VDB.
8             #
9             # perl-Dist-Zilla-PluginBundle-Author-VDB is free software: you can redistribute it and/or modify
10             # it under the terms of the GNU General Public License as published by the Free Software
11             # Foundation, either version 3 of the License, or (at your option) any later version.
12             #
13             # perl-Dist-Zilla-PluginBundle-Author-VDB is distributed in the hope that it will be useful, but
14             # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15             # PARTICULAR PURPOSE. See the GNU General Public License for more details.
16             #
17             # You should have received a copy of the GNU General Public License along with
18             # perl-Dist-Zilla-PluginBundle-Author-VDB. If not, see <http://www.gnu.org/licenses/>.
19             #
20             # ---------------------------------------------------------------------- copyright and license ---
21              
22             #pod =for test_synopsis BEGIN { die "SKIP: not a Perl code"; }
23             #pod
24             #pod =head1 SYNOPSIS
25             #pod
26             #pod F<dist.in> file:
27             #pod
28             #pod [Author::VDB::Hg::Status]
29             #pod
30             #pod =head1 DESCRIPTION
31             #pod
32             #pod This plugin does C<BeforeRelease> role. It makes sure all the files are committed to Mercurial
33             #pod repository. If there are modified, added, removed, not tracked, or missed files, the plugin aborts
34             #pod release.
35             #pod
36             #pod =cut
37              
38             # --------------------------------------------------------------------------------------------------
39              
40             package Dist::Zilla::Plugin::Author::VDB::Hg::Status;
41              
42 1     1   2081 use Moose;
  1         3  
  1         13  
43 1     1   6998 use namespace::autoclean;
  1         2  
  1         12  
44 1     1   79 use version 0.77;
  1         28  
  1         8  
45              
46             # ABSTRACT: Make sure there are no changed files
47             our $VERSION = 'v0.11.2_04'; # TRIAL VERSION
48              
49             with 'Dist::Zilla::Role::BeforeRelease';
50             with 'Dist::Zilla::Role::ErrorLogger';
51             with 'Dist::Zilla::Role::Author::VDB::HgRunner';
52              
53             #pod =for Pod::Coverage before_release
54             #pod
55             #pod =cut
56              
57             sub before_release {
58 0     0 0   my ( $self ) = @_;
59 0           my $status = $self->run_hg( 'status' );
60 0 0         if ( @$status ) {
61 0           $self->log_error( 'Changed files:' );
62 0           $self->log_error( " $_" ) for @$status;
63 0           $self->abort();
64             };
65 0           return;
66             };
67              
68             # --------------------------------------------------------------------------------------------------
69              
70             __PACKAGE__->meta->make_immutable();
71              
72             1;
73              
74             # --------------------------------------------------------------------------------------------------
75              
76             #pod =head1 COPYRIGHT AND LICENSE
77             #pod
78             #pod Copyright (C) 2015 Van de Bugger
79             #pod
80             #pod License GPLv3+: The GNU General Public License version 3 or later
81             #pod <http://www.gnu.org/licenses/gpl-3.0.txt>.
82             #pod
83             #pod This is free software: you are free to change and redistribute it. There is
84             #pod NO WARRANTY, to the extent permitted by law.
85             #pod
86             #pod
87             #pod =cut
88              
89             # end of file #
90              
91             __END__
92              
93             =pod
94              
95             =encoding UTF-8
96              
97             =head1 NAME
98              
99             Dist::Zilla::Plugin::Author::VDB::Hg::Status - Make sure there are no changed files
100              
101             =head1 VERSION
102              
103             Version v0.11.2_04, released on 2016-12-06 20:27 UTC.
104             This is a B<trial release>.
105              
106             =for test_synopsis BEGIN { die "SKIP: not a Perl code"; }
107              
108             =head1 SYNOPSIS
109              
110             F<dist.in> file:
111              
112             [Author::VDB::Hg::Status]
113              
114             =head1 DESCRIPTION
115              
116             This plugin does C<BeforeRelease> role. It makes sure all the files are committed to Mercurial
117             repository. If there are modified, added, removed, not tracked, or missed files, the plugin aborts
118             release.
119              
120             =for Pod::Coverage before_release
121              
122             =head1 AUTHOR
123              
124             Van de Bugger <van.de.bugger@gmail.com>
125              
126             =head1 COPYRIGHT AND LICENSE
127              
128             Copyright (C) 2015 Van de Bugger
129              
130             License GPLv3+: The GNU General Public License version 3 or later
131             <http://www.gnu.org/licenses/gpl-3.0.txt>.
132              
133             This is free software: you are free to change and redistribute it. There is
134             NO WARRANTY, to the extent permitted by law.
135              
136             =cut