File Coverage

blib/lib/App/Embra/Role/FileGatherer.pm
Criterion Covered Total %
statement 21 21 100.0
branch 3 6 50.0
condition 2 3 66.6
subroutine 6 6 100.0
pod n/a
total 32 36 88.8


line stmt bran cond sub pod time code
1 9     9   43467 use strict;
  9         18  
  9         391  
2 9     9   46 use warnings;
  9         14  
  9         486  
3              
4             package App::Embra::Role::FileGatherer;
5             $App::Embra::Role::FileGatherer::VERSION = '0.001'; # TRIAL
6             # ABSTRACT: something that adds file to your site
7              
8 9     9   45 use Method::Signatures;
  9         11  
  9         69  
9 9     9   3759 use Moo::Role;
  9         17  
  9         61  
10              
11              
12             with 'App::Embra::Role::Plugin';
13              
14             requires 'gather_files';
15              
16              
17 9 50 66 9   153646 method add_file( App::Embra::File $file ) {
  21 50   21   225  
  21 50       76  
  21         33  
  21         216  
  21         2545504  
18 21         103 $self->debug( "gathered $file" );
19 21         858 push @{ $self->embra->files }, $file;
  21         308  
20             }
21              
22             1;
23              
24             __END__
25              
26             =pod
27              
28             =encoding UTF-8
29              
30             =head1 NAME
31              
32             App::Embra::Role::FileGatherer - something that adds file to your site
33              
34             =head1 VERSION
35              
36             version 0.001
37              
38             =head1 DESCRIPTION
39              
40             This role should be implemented by any plugin which plans to add files to your site. It provides one method (C<L</add_file>>), and requires plugins provide a C<gather_files> method.
41              
42             C<gather_files> will be called early in the site collation process, and is expected to call the provided C<L</add_file>> method for each file it wishes to include in the site.
43              
44             =head1 METHODS
45              
46             =head2 add_file
47              
48             $plugin->add_file( $app_embra_file );
49              
50             This adds a file to the site.
51              
52             =head1 AUTHOR
53              
54             Daniel Holz <dgholz@gmail.com>
55              
56             =head1 COPYRIGHT AND LICENSE
57              
58             This software is copyright (c) 2015 by Daniel Holz.
59              
60             This is free software; you can redistribute it and/or modify it under
61             the same terms as the Perl 5 programming language system itself.
62              
63             =cut