File Coverage

blib/lib/Dist/Zilla/File/Generated.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Dist::Zilla::File::Generated;
2             $Dist::Zilla::File::Generated::VERSION = '0.0.10';
3             # ABSTRACT: a file whose content is built on demand and changed later
4 2     2   6 use Moose;
  2         3  
  2         8  
5              
6 2     2   7532 use namespace::autoclean;
  2         888  
  2         12  
7              
8             extends 'Dist::Zilla::File::FromCode';
9              
10             has 'content' => (
11             is => 'rw',
12             isa => 'Str',
13             lazy => 1,
14            
15             builder => '_build_content',
16             );
17              
18              
19             sub _build_content {
20 6     6   4 my ($self) = @_;
21              
22 6         117 my $code = $self->code;
23            
24 6         25 return $self->$code;
25             }
26              
27             __PACKAGE__->meta->make_immutable;
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Dist::Zilla::File::Generated - a file whose content is built on demand and changed later
39              
40             =head1 VERSION
41              
42             version 0.0.10
43              
44             =head1 AUTHOR
45              
46             Nickolay Platonov <nplatonov@cpan.org>
47              
48             =head1 COPYRIGHT AND LICENSE
49              
50             This software is copyright (c) 2015 by Nickolay Platonov.
51              
52             This is free software; you can redistribute it and/or modify it under
53             the same terms as the Perl 5 programming language system itself.
54              
55             =cut