File Coverage

blib/lib/App/Embra/Plugin/SnippetsToNotes.pm
Criterion Covered Total %
statement 22 22 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod n/a
total 29 30 96.6


line stmt bran cond sub pod time code
1 1     1   562 use strict;
  1         2  
  1         36  
2 1     1   4 use warnings;
  1         1  
  1         43  
3              
4             package App::Embra::Plugin::SnippetsToNotes;
5             $App::Embra::Plugin::SnippetsToNotes::VERSION = '0.001'; # TRIAL
6             # ABSTRACT: add fragments of HTML from plugins to file notes
7              
8 1     1   3 use Method::Signatures;
  1         2  
  1         6  
9 1     1   316 use Moo;
  1         2  
  1         4  
10              
11              
12 1 50   1   805 method transform_files {
  1     1   8  
  1         5  
13 1         1 my %snippets;
14 1         7 for my $snippet ( $self->embra->plugins_with( '-Snippet' ) ) {
15 1         43 push @{ $snippets{ $snippet->clipboard } }, $snippet->fragment;
  1         8  
16             }
17 1         1 for ( @{ $self->embra->files } ) {
  1         6  
18 1         6 $_->update_notes( snippets => \%snippets );
19             }
20             }
21              
22             with 'App::Embra::Role::FileTransformer';
23              
24             1;
25              
26             __END__
27              
28             =pod
29              
30             =encoding UTF-8
31              
32             =head1 NAME
33              
34             App::Embra::Plugin::SnippetsToNotes - add fragments of HTML from plugins to file notes
35              
36             =head1 VERSION
37              
38             version 0.001
39              
40             =head1 DESCRIPTION
41              
42             This plugin will find all the plugins which have L<snippets|App::Embra::Plugin::Snippets>, and then add their HTML fragments as notes to the files in your site.
43              
44             This is a L<FileTransformer|App::Embra::Role::FileTransformer> plugin.
45              
46             =head1 AUTHOR
47              
48             Daniel Holz <dgholz@gmail.com>
49              
50             =head1 COPYRIGHT AND LICENSE
51              
52             This software is copyright (c) 2015 by Daniel Holz.
53              
54             This is free software; you can redistribute it and/or modify it under
55             the same terms as the Perl 5 programming language system itself.
56              
57             =cut