blib/lib/Dist/Zilla/MVP/Assembler/Zilla.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 66.6% 2 / 3 totaltotal 95.1% 39 / 41 CC 2 SCAR 2.0
CC
2
Cov
97%
register_stash
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Dist/Zilla/App/Command.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/TemplateModule.pm »
1 package Dist::Zilla::MVP::Assembler::Zilla 6.040;
2 # ABSTRACT: Dist::Zilla::MVP::Assembler for the Dist::Zilla object
3  
4 51 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 51 extends 'Dist::Zilla::MVP::Assembler';
6  
7 51 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 51 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 #pod =head1 OVERVIEW
12 #pod
13 #pod This is a subclass of L<Dist::Zilla::MVP::Assembler> used when assembling the
14 #pod Dist::Zilla object.
15 #pod
16 #pod It has a C<zilla_class> attribute, which is used to determine what class of
17 #pod Dist::Zilla object to create. (This isn't very useful now, but will be in the
18 #pod future when minting and building use different subclasses of Dist::Zilla.)
19 #pod
20 #pod Upon construction, the assembler will create a L<Dist::Zilla::MVP::RootSection>
21 #pod as the initial section.
22 #pod
23 #pod =cut
24  
25 51 ▶use MooseX::Types::Perl qw(PackageName);
Subroutine BEGIN: called CC=1 SCAR=0.0
26 51 ▶use Dist::Zilla::MVP::RootSection;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 199 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
29 199 my ($self) = @_;
30  
31 199 my $root = Dist::Zilla::MVP::RootSection->new;
32 199 $self->sequence->add_section($root);
33 }
34  
35 51 has zilla_class => (
36 is => 'ro',
37 isa => PackageName,
38 required => 1
39 );
40  
41 #pod =method zilla
42 #pod
43 #pod This method is a shortcut for retrieving the C<zilla> from the root section.
44 #pod If called before that section has been finalized, it will result in an
45 #pod exception.
46 #pod
47 #pod =cut
48  
49 778 ▶sub zilla {
Subroutine zilla: called CC=1 SCAR=0.0
Pod documented
50 778 my ($self) = @_;
51 778 $self->sequence->section_named('_')->zilla;
52 }
53  
54 #pod =method register_stash
55 #pod
56 #pod $assembler->register_stash($name => $stash_object);
57 #pod
58 #pod This adds a stash to the assembler's zilla's stash registry -- unless the name
59 #pod is already taken, in which case an exception is raised.
60 #pod
61 #pod =cut
62  
63 5 ▶sub register_stash {
Subroutine register_stash: called CC=2 SCAR=7.0
Pod documented
64 5 my ($self, $name, $object) = @_;
65 $self->log_fatal("tried to register $name stash entry twice")
66 5 ▶ if $self->zilla->_local_stashes->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
if $self->zilla->_local_stashes->{$name} 0 5 5
67  
68 5 $self->zilla->_local_stashes->{ $name } = $object;
69 5 return;
70 }
71  
72 51 __PACKAGE__->meta->make_immutable;
73 51 1;
74  
75 __END__
« blib/lib/Dist/Zilla/App/Command.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/TemplateModule.pm »