PerlDistSite/Component.pm untested

filter: Statementstmt 0.0% 0 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 16 CC 1 SCAR 6.9
CC
1
Cov
0%
write
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Web::PerlDistSite::Component;
2  
3 our $VERSION = '0.001008';
4  
5 use Moo::Role;
6 use Web::PerlDistSite::Common -lexical, -all;
7  
8 requires 'raw_content', 'filename';
9  
10 has project => (
11 is       => 'rw',
12 isa      => Object,
13 );
14  
15 sub write ( $self ) {
16 my $path = $self->project->root->child( $self->filename );
17 $path->parent->mkpath;
18 $path->spew_if_changed( $self->raw_content );
19 }
20  
21 1;