blib/lib/Dist/Zilla/File/OnDisk.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod n/a totaltotal 93.5% 29 / 31 CC 1 SCAR 1.2
CC
1
Cov
96%
_build_content
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Dist/Zilla/Role/Plugin.pm ↑ Summary blib/lib/Dist/Zilla/Role/Stash.pm »
1 package Dist::Zilla::File::OnDisk 6.040;
2 # ABSTRACT: a file that comes from your filesystem
3  
4 53 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 53 with 'Dist::Zilla::Role::MutableFile', 'Dist::Zilla::Role::StubBuild';
6  
7 53 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 53 ▶use Dist::Zilla::Path;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 53 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 #pod =head1 DESCRIPTION
14 #pod
15 #pod This represents a file stored on disk. Its C<content> attribute is read from
16 #pod the originally given file name when first read, but is then kept in memory and
17 #pod may be altered by plugins.
18 #pod
19 #pod =cut
20  
21 53 has _original_name => (
22 is => 'ro',
23 writer => '_set_original_name',
24 isa => 'Str',
25 init_arg => undef,
26 );
27  
28 674 ▶after 'BUILD' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
29 674 my ($self) = @_;
30 674 $self->_set_original_name( $self->name );
31 53 };
32  
33 601 ▶sub _build_encoded_content {
Subroutine _build_encoded_content: called CC=1 SCAR=0.0
34 601 my ($self) = @_;
35 601 return path($self->_original_name)->slurp_raw;
36 }
37  
38 674 ▶sub _build_content_source { return "encoded_content" }
Subroutine _build_content_source: called CC=1 SCAR=0.0
39  
40 # should never be called, as content will always be generated from
41 # encoded content
42 0 ▶sub _build_content { die "shouldn't reach here" }
Subroutine _build_content: not called CC=1 SCAR=6.9
43  
44 53 __PACKAGE__->meta->make_immutable;
45 53 1;
46  
47 __END__
« blib/lib/Dist/Zilla/Role/Plugin.pm ↑ Summary blib/lib/Dist/Zilla/Role/Stash.pm »