File Coverage

blib/lib/Dist/Zilla/Plugin/Author/VDB/Hg/Push.pm
Criterion Covered Total %
statement 11 16 68.7
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 3 0.0
total 16 25 64.0


line stmt bran cond sub pod time code
1             # ---------------------------------------------------------------------- copyright and license ---
2             #
3             # file: lib/Dist/Zilla/Plugin/Author/VDB/Hg/Push.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::Push]
29             #pod repository = default ; This is default.
30             #pod repository = remote
31             #pod ...
32             #pod
33             #pod =head1 DESCRIPTION
34             #pod
35             #pod This plugin does C<AfterRelease> role. It pushes changes from the current repository to the
36             #pod (remote) repositories. Multiple repositories can be specified.
37             #pod
38             #pod =cut
39              
40             # --------------------------------------------------------------------------------------------------
41              
42             package Dist::Zilla::Plugin::Author::VDB::Hg::Push;
43              
44 1     1   1205 use Moose;
  1         1  
  1         8  
45 1     1   5583 use namespace::autoclean;
  1         1  
  1         11  
46 1     1   87 use version 0.77;
  1         29  
  1         7  
47              
48             # ABSTRACT: Push changes to (remote) repositories
49             our $VERSION = 'v0.11.2_06'; # TRIAL VERSION
50              
51             with 'Dist::Zilla::Role::AfterRelease';
52             with 'Dist::Zilla::Role::ErrorLogger';
53             with 'Dist::Zilla::Role::Author::VDB::HgRunner';
54              
55             #pod =option repository
56             #pod
57             #pod =option repositories
58             #pod
59             #pod (Remote) repository name to push changes to. May be repeated multiple times to push changes to
60             #pod several repositories.
61             #pod
62             #pod =cut
63              
64             has repositories => (
65             isa => 'ArrayRef[Str]',
66             is => 'ro',
67             default => sub { [ 'default' ] },
68             );
69              
70             # --------------------------------------------------------------------------------------------------
71              
72             #pod =for Pod::Coverage mvp_aliases mvp_multivalue_args
73             #pod
74             #pod =cut
75              
76             sub mvp_aliases {
77             return {
78 8     8 0 1114 'repository' => 'repositories',
79             };
80             };
81              
82             sub mvp_multivalue_args {
83 8     8 0 6526 return qw{ repositories };
84             };
85              
86             # --------------------------------------------------------------------------------------------------
87              
88             #pod =for Pod::Coverage after_release
89             #pod
90             #pod =cut
91              
92             sub after_release {
93 0     0 0   my ( $self ) = @_;
94 0           for my $repo ( @{ $self->repositories } ) {
  0            
95 0           $self->run_hg( 'push', $repo );
96             };
97 0           return;
98             };
99              
100             # --------------------------------------------------------------------------------------------------
101              
102             __PACKAGE__->meta->make_immutable();
103              
104             1;
105              
106             # --------------------------------------------------------------------------------------------------
107              
108             #pod =head1 COPYRIGHT AND LICENSE
109             #pod
110             #pod Copyright (C) 2015 Van de Bugger
111             #pod
112             #pod License GPLv3+: The GNU General Public License version 3 or later
113             #pod <http://www.gnu.org/licenses/gpl-3.0.txt>.
114             #pod
115             #pod This is free software: you are free to change and redistribute it. There is
116             #pod NO WARRANTY, to the extent permitted by law.
117             #pod
118             #pod
119             #pod =cut
120              
121             # end of file #
122              
123             __END__
124              
125             =pod
126              
127             =encoding UTF-8
128              
129             =head1 NAME
130              
131             Dist::Zilla::Plugin::Author::VDB::Hg::Push - Push changes to (remote) repositories
132              
133             =head1 VERSION
134              
135             Version v0.11.2_06, released on 2016-12-15 22:13 UTC.
136             This is a B<trial release>.
137              
138             =for test_synopsis BEGIN { die "SKIP: not a Perl code"; }
139              
140             =head1 SYNOPSIS
141              
142             F<dist.in> file:
143              
144             [Author::VDB::Hg::Push]
145             repository = default ; This is default.
146             repository = remote
147             ...
148              
149             =head1 DESCRIPTION
150              
151             This plugin does C<AfterRelease> role. It pushes changes from the current repository to the
152             (remote) repositories. Multiple repositories can be specified.
153              
154             =head1 OPTIONS
155              
156             =head2 repository
157              
158             =head2 repositories
159              
160             (Remote) repository name to push changes to. May be repeated multiple times to push changes to
161             several repositories.
162              
163             =for Pod::Coverage mvp_aliases mvp_multivalue_args
164              
165             =for Pod::Coverage after_release
166              
167             =head1 AUTHOR
168              
169             Van de Bugger <van.de.bugger@gmail.com>
170              
171             =head1 COPYRIGHT AND LICENSE
172              
173             Copyright (C) 2015 Van de Bugger
174              
175             License GPLv3+: The GNU General Public License version 3 or later
176             <http://www.gnu.org/licenses/gpl-3.0.txt>.
177              
178             This is free software: you are free to change and redistribute it. There is
179             NO WARRANTY, to the extent permitted by law.
180              
181             =cut