Plugin/Hook.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 18 / 18 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Role/Hooker.pm ↑ Summary Plugin/Hook/AfterBuild.pm »
1 # ---------------------------------------------------------------------- copyright and license ---
2 #
3 # file: lib/Dist/Zilla/Plugin/Hook.pm
4 #
5 # Copyright © 2015, 2016, 2018 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 # SPDX-License-Identifier: GPL-3.0-or-later
21 #
22 # ---------------------------------------------------------------------- copyright and license ---
23  
24 #pod =for :this This is C<Dist::Zilla::Plugin::Hook> module documentation. Read this if you are going to hack or
25 #pod extend C<Dist-Zilla-Plugin-Hook>.
26 #pod
27 #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
28 #pod topics like getting source, building, installing, bug reporting and some others are covered in the
29 #pod F<README>.
30 #pod
31 #pod =head1 DESCRIPTION
32 #pod
33 #pod This plugin consumes C<Hooker> role like all other C<Hook> plugins. However, this plugin I<never>
34 #pod executes its Perl code. Instead, it just stores it for later use. As of today, only C<Hook> plugin
35 #pod with C<prologue> name is actually used:
36 #pod
37 #pod [Hook/prologue]
38 #pod . = use autodie ':all';
39 #pod
40 #pod Such code will be executed just before each hook. Note again: C<Hook> itself does not execute its
41 #pod code; if there are no other hooks in F<dist.ini>, this code will never execute.
42 #pod
43 #pod BTW, C<Dist::Zilla> and CPAN do not handle well distributions with no main module. This is also a
44 #pod "main" module of C<Dist-Zilla-Plugin-Hook> distribution, to make C<Dist::Zilla> and C<CPAN> indexer happy.
45 #pod
46 #pod =head1 SEE ALSO
47 #pod
48 #pod =for :list
49 #pod = L<Dist::Zilla>
50 #pod = L<Dist::Zilla::Plugin::Hook::Manual>
51 #pod = L<Dist::Zilla::Role::Hooker>
52 #pod
53 #pod =cut
54  
55 package Dist::Zilla::Plugin::Hook;
56  
57 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
58 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
59 2 ▶use version 0.77;
Subroutine BEGIN: called CC=1 SCAR=0.0
60  
61 # ABSTRACT: Write C<Dist::Zilla> plugin directly in F<dist.ini>
62 2 our $VERSION = 'v0.8.4'; # VERSION
63  
64 2 with 'Dist::Zilla::Role::Plugin';
65 2 with 'Dist::Zilla::Role::ErrorLogger' => { -version => 0.005 };
66 2 with 'Dist::Zilla::Role::Hooker';
67  
68 2 __PACKAGE__->meta->make_immutable();
69  
70 2 1;
71  
72 #pod =head1 COPYRIGHT AND LICENSE
73 #pod
74 #pod Copyright (C) 2015, 2016, 2018 Van de Bugger
75 #pod
76 #pod License GPLv3+: The GNU General Public License version 3 or later
77 #pod <http://www.gnu.org/licenses/gpl-3.0.txt>.
78 #pod
79 #pod This is free software: you are free to change and redistribute it. There is
80 #pod NO WARRANTY, to the extent permitted by law.
81 #pod
82 #pod
83 #pod =cut
84  
85 # ------------------------------------------------------------------------------------------------
86 #
87 # file: doc/what.pod
88 #
89 # Copyright © 2015, 2016, 2018 Van de Bugger.
90 #
91 # This file is part of perl-Dist-Zilla-Plugin-Hook.
92 #
93 # SPDX-License-Identifier: GPL-3.0-or-later
94 #
95 # ------------------------------------------------------------------------------------------------
96  
97 #pod =encoding UTF-8
98 #pod
99 #pod =head1 WHAT?
100 #pod
101 #pod C<Dist-Zilla-Plugin-Hook> (or just C<Hook>) is a set of C<Dist-Zilla> plugins. Every plugin executes Perl
102 #pod code inlined into F<dist.ini> at particular stage of build process.
103 #pod
104 #pod =cut
105  
106 # end of file #
107  
108  
109 # end of file #
110  
111 __END__
« Role/Hooker.pm ↑ Summary Plugin/Hook/AfterBuild.pm »