| 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 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 43 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 44 | 1 | ▶ | use version 0.77; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 45 | |||||||||||
| 46 | # ABSTRACT: Make sure there are no changed files | ||||||||||
| 47 | 1 | our $VERSION = 'v0.11.3.1'; # TRIAL VERSION | |||||||||
| 48 | |||||||||||
| 49 | 1 | with 'Dist::Zilla::Role::BeforeRelease'; | |||||||||
| 50 | 1 | with 'Dist::Zilla::Role::ErrorLogger'; | |||||||||
| 51 | 1 | with 'Dist::Zilla::Role::Author::VDB::HgRunner'; | |||||||||
| 52 | |||||||||||
| 53 | #pod =for Pod::Coverage before_release | ||||||||||
| 54 | #pod | ||||||||||
| 55 | #pod =cut | ||||||||||
| 56 | |||||||||||
| 57 | 0 | ▶ | sub before_release { | ||||||||
|
Subroutine
before_release: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 58 | 0 | my ( $self ) = @_; | |||||||||
| 59 | 0 | my $status = $self->run_hg( 'status' ); | |||||||||
| 60 | 0 | ▶ | if ( @$status ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | 1 | __PACKAGE__->meta->make_immutable(); | |||||||||
| 71 | |||||||||||
| 72 | 1 | 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__ | ||||||||||