PluginBundle/Code.pm

filter: Statementstmt 100% 29 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 97.3% 36 / 37 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Plugin/Code/VersionProvider.pm ↑ Summary Plugin/Code.pm »
1 # vim: ts=4 sts=4 sw=4 et: syntax=perl
2 #
3 # Copyright (c) 2020-2023 Sven Kirmess
4 #
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  
17 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 package Dist::Zilla::PluginBundle::Code;
22  
23 2 our $VERSION = '0.008';
24  
25 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 2 with 'Dist::Zilla::Role::PluginBundle';
29  
30 2 ▶use MooseX::Types::Moose qw(CodeRef HashRef Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 2 has bundle_config => (
33 is => 'ro',
34 isa => CodeRef,
35 reader => '_bundle_config',
36 required => 1,
37 );
38  
39 2 has name => (
40 is => 'ro',
41 isa => Str,
42 required => 1,
43 );
44  
45 2 has payload => (
46 is => 'ro',
47 isa => HashRef,
48 required => 1,
49 );
50  
51 2 ▶sub bundle_config {
Subroutine bundle_config: called CC=1 SCAR=0.0
Pod undocumented
52 2 my ( $class, $section ) = @_;
53  
54 2 $section->{bundle_config} = delete $section->{payload}->{bundle_config};
55  
56 2 my $self = $class->new($section);
57  
58 1 my $code_ref = $self->_bundle_config;
59 1 return $self->$code_ref;
60 }
61  
62 2 __PACKAGE__->meta->make_immutable;
63  
64 2 1;
65  
66 __END__
« Plugin/Code/VersionProvider.pm ↑ Summary Plugin/Code.pm »