File Coverage

blib/lib/Dist/Zilla/Plugin/Run/BeforeBuild.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 21 22 95.4


line stmt bran cond sub pod time code
1 8     8   24956498 use strict;
  8         27  
  8         316  
2 8     8   72 use warnings;
  8         32  
  8         580  
3              
4             package Dist::Zilla::Plugin::Run::BeforeBuild;
5             # ABSTRACT: execute a command of the distribution before build
6              
7             our $VERSION = '0.049';
8              
9 8     8   68 use Moose;
  8         28  
  8         70  
10             with qw(
11             Dist::Zilla::Role::BeforeBuild
12             Dist::Zilla::Plugin::Run::Role::Runner
13             );
14              
15 8     8   53872 use namespace::autoclean;
  8         28  
  8         63  
16              
17             sub before_build {
18 28     28 0 650429 my ($self) = @_;
19             $self->_call_script({
20 28     4   440 pos => [sub { $self->zilla->version }]
  4         127  
21             });
22             }
23              
24             #pod =head1 SYNOPSIS
25             #pod
26             #pod [Run::BeforeBuild]
27             #pod run = script/do_this.pl --version %v
28             #pod run = script/do_that.pl
29             #pod
30             #pod =head1 DESCRIPTION
31             #pod
32             #pod This plugin executes the specified command before building the distribution.
33             #pod
34             #pod =head1 POSITIONAL PARAMETERS
35             #pod
36             #pod See L<Dist::Zilla::Plugin::Run/CONVERSIONS>
37             #pod for the list of common formatting variables available to all plugins.
38             #pod
39             #pod For backward compatibility:
40             #pod
41             #pod =for :list
42             #pod * The 1st C<%s> will be replaced by the distribution version.
43             #pod
44             #pod =cut
45              
46             1;
47              
48             __END__
49              
50             =pod
51              
52             =encoding UTF-8
53              
54             =head1 NAME
55              
56             Dist::Zilla::Plugin::Run::BeforeBuild - execute a command of the distribution before build
57              
58             =head1 VERSION
59              
60             version 0.049
61              
62             =head1 SYNOPSIS
63              
64             [Run::BeforeBuild]
65             run = script/do_this.pl --version %v
66             run = script/do_that.pl
67              
68             =head1 DESCRIPTION
69              
70             This plugin executes the specified command before building the distribution.
71              
72             =head1 POSITIONAL PARAMETERS
73              
74             See L<Dist::Zilla::Plugin::Run/CONVERSIONS>
75             for the list of common formatting variables available to all plugins.
76              
77             For backward compatibility:
78              
79             =over 4
80              
81             =item *
82              
83             The 1st C<%s> will be replaced by the distribution version.
84              
85             =back
86              
87             =head1 SUPPORT
88              
89             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Run>
90             (or L<bug-Dist-Zilla-Plugin-Run@rt.cpan.org|mailto:bug-Dist-Zilla-Plugin-Run@rt.cpan.org>).
91              
92             There is also a mailing list available for users of this distribution, at
93             L<http://dzil.org/#mailing-list>.
94              
95             There is also an irc channel available for users of this distribution, at
96             L<C<#distzilla> on C<irc.perl.org>|irc://irc.perl.org/#distzilla>.
97              
98             =head1 AUTHOR
99              
100             Torsten Raudssus <torsten@raudss.us> L<https://raudss.us/>
101              
102             =head1 COPYRIGHT AND LICENCE
103              
104             This software is copyright (c) 2010 by L<Raudssus Social Software|https://raudss.us/>.
105              
106             This is free software; you can redistribute it and/or modify it under
107             the same terms as the Perl 5 programming language system itself.
108              
109             =cut