PurePerl/NewObject/Tree.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 26 / 26 CC 2 SCAR 2.9
CC
2
Cov
100%
_build_content
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« PurePerl/Loose.pm ↑ Summary PurePerl/Protocol/SSH.pm »
1 package Git::PurePerl::NewObject::Tree;
2 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 extends 'Git::PurePerl::NewObject';
8  
9 4 has 'kind' =>
10 ( is => 'ro', isa => 'ObjectKind', required => 1, default => 'tree' );
11 4 has 'directory_entries' => (
12 is => 'rw',
13 isa => 'ArrayRef[Git::PurePerl::NewDirectoryEntry]',
14 required => 1,
15 auto_deref => 1,
16 );
17  
18 4 ▶sub _build_content {
Subroutine _build_content: called CC=2 SCAR=6.9
19 4 my $self = shift;
20 4 my $content;
21 4 foreach my $de ( $self->directory_entries ) {
22 8 $content
23 .= $de->mode . ' '
24 . $de->filename . "\0"
25 . pack( 'H*', $de->sha1 );
26 }
27 4 $self->content($content);
28 }
29  
30 4 __PACKAGE__->meta->make_immutable;
31  
« PurePerl/Loose.pm ↑ Summary PurePerl/Protocol/SSH.pm »