File Coverage

blib/lib/Dist/Zilla/Plugin/Hook.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2             #
3             # file: lib/Dist/Zilla/Plugin/Hook.pm
4             #
5             # Copyright © 2015 Van de Bugger
6             #
7             # This file is part of perl-Dist-Zilla-Plugin-Hook.
8             #
9             # perl-Dist-Zilla-Plugin-Hook is free software: you can redistribute it and/or modify it under
10             # the terms of the GNU General Public License as published by the Free Software Foundation,
11             # either version 3 of the License, or (at your option) any later version.
12             #
13             # perl-Dist-Zilla-Plugin-Hook is distributed in the hope that it will be useful, but WITHOUT ANY
14             # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15             # 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-Plugin-Hook. If not, see <http://www.gnu.org/licenses/>.
19             #
20             # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
21              
22             #pod =for :this This is C<Dist::Zilla::Plugin::Hook> module documentation. Read this if you are going to hack or
23             #pod extend C<Dist-Zilla-Plugin-Hook>.
24             #pod
25             #pod =for :those If you want to write C<Dist::Zilla> plugin directly in F<dist.ini>, read the L<manual|Dist::Zilla::Plugin::Hook::Manual>. General
26             #pod topics like getting source, building, installing, bug reporting and some others are covered in the
27             #pod F<README>.
28             #pod
29             #pod =head1 DESCRIPTION
30             #pod
31             #pod This plugin consumes C<Hooker> role like all other C<Hook> plugins. However, this plugin I<never>
32             #pod executes its Perl code. Instead, it just stores it for later use. As of today, only C<Hook> plugin
33             #pod with C<prologue> name is actually used:
34             #pod
35             #pod [Hook/prologue]
36             #pod . = use autodie ':all';
37             #pod
38             #pod Such code will be executed just before each hook. Note again: C<Hook> itself does not execute its
39             #pod code; if there are no other hooks in F<dist.ini>, this code will never execute.
40             #pod
41             #pod BTW, C<Dist::Zilla> and CPAN do not handle well distributions with no main module. This is also a
42             #pod "main" module of C<Dist-Zilla-Plugin-Hook> distribution, to make C<Dist::Zilla> and C<CPAN> indexer happy.
43             #pod
44             #pod =head1 SEE ALSO
45             #pod
46             #pod =for :list
47             #pod = L<Dist::Zilla>
48             #pod = L<Dist::Zilla::Plugin::Hook::Manual>
49             #pod = L<Dist::Zilla::Role::Hooker>
50             #pod
51             #pod =cut
52              
53             package Dist::Zilla::Plugin::Hook;
54              
55 1     1   23265 use Moose;
  1         1  
  1         5  
56 1     1   4241 use namespace::autoclean;
  1         2  
  1         8  
57 1     1   59 use version 0.77;
  1         22  
  1         6  
58              
59             # ABSTRACT: Write C<Dist::Zilla> plugin directly in F<dist.ini>
60             our $VERSION = 'v0.8.1_01'; # TRIAL VERSION
61              
62             with 'Dist::Zilla::Role::Plugin';
63             with 'Dist::Zilla::Role::ErrorLogger' => { -version => 0.005 };
64             with 'Dist::Zilla::Role::Hooker';
65              
66             __PACKAGE__->meta->make_immutable();
67              
68             1;
69              
70             #pod =head1 COPYRIGHT AND LICENSE
71             #pod
72             #pod Copyright (C) 2015 Van de Bugger
73             #pod
74             #pod License GPLv3+: The GNU General Public License version 3 or later
75             #pod <http://www.gnu.org/licenses/gpl-3.0.txt>.
76             #pod
77             #pod This is free software: you are free to change and redistribute it. There is
78             #pod NO WARRANTY, to the extent permitted by law.
79             #pod
80             #pod
81             #pod =cut
82              
83             # doc/what.pod #
84              
85             #pod =encoding UTF-8
86             #pod
87             #pod =head1 WHAT?
88             #pod
89             #pod C<Dist-Zilla-Plugin-Hook> (or just C<Hook>) is a set of C<Dist-Zilla> plugins. Every plugin executes Perl
90             #pod code inlined into F<dist.ini> at particular stage of build process.
91             #pod
92             #pod =cut
93              
94             # end of file #
95              
96              
97             # end of file #
98              
99             __END__
100              
101             =pod
102              
103             =encoding UTF-8
104              
105             =head1 NAME
106              
107             Dist::Zilla::Plugin::Hook - Write C<Dist::Zilla> plugin directly in F<dist.ini>
108              
109             =head1 VERSION
110              
111             Version v0.8.1_01, released on 2016-10-11 00:10 UTC.
112             This is a B<trial release>.
113              
114             =head1 WHAT?
115              
116             C<Dist-Zilla-Plugin-Hook> (or just C<Hook>) is a set of C<Dist-Zilla> plugins. Every plugin executes Perl
117             code inlined into F<dist.ini> at particular stage of build process.
118              
119             This is C<Dist::Zilla::Plugin::Hook> module documentation. Read this if you are going to hack or
120             extend C<Dist-Zilla-Plugin-Hook>.
121              
122             If you want to write C<Dist::Zilla> plugin directly in F<dist.ini>, read the L<manual|Dist::Zilla::Plugin::Hook::Manual>. General
123             topics like getting source, building, installing, bug reporting and some others are covered in the
124             F<README>.
125              
126             =head1 DESCRIPTION
127              
128             This plugin consumes C<Hooker> role like all other C<Hook> plugins. However, this plugin I<never>
129             executes its Perl code. Instead, it just stores it for later use. As of today, only C<Hook> plugin
130             with C<prologue> name is actually used:
131              
132             [Hook/prologue]
133             . = use autodie ':all';
134              
135             Such code will be executed just before each hook. Note again: C<Hook> itself does not execute its
136             code; if there are no other hooks in F<dist.ini>, this code will never execute.
137              
138             BTW, C<Dist::Zilla> and CPAN do not handle well distributions with no main module. This is also a
139             "main" module of C<Dist-Zilla-Plugin-Hook> distribution, to make C<Dist::Zilla> and C<CPAN> indexer happy.
140              
141             =head1 SEE ALSO
142              
143             =over 4
144              
145             =item L<Dist::Zilla>
146              
147             =item L<Dist::Zilla::Plugin::Hook::Manual>
148              
149             =item L<Dist::Zilla::Role::Hooker>
150              
151             =back
152              
153             =head1 AUTHOR
154              
155             Van de Bugger <van.de.bugger@gmail.com>
156              
157             =head1 COPYRIGHT AND LICENSE
158              
159             Copyright (C) 2015 Van de Bugger
160              
161             License GPLv3+: The GNU General Public License version 3 or later
162             <http://www.gnu.org/licenses/gpl-3.0.txt>.
163              
164             This is free software: you are free to change and redistribute it. There is
165             NO WARRANTY, to the extent permitted by law.
166              
167             =cut