File Coverage

blib/lib/App/Embra/Plugin/Favicon.pm
Criterion Covered Total %
statement 16 16 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod n/a
total 23 24 95.8


line stmt bran cond sub pod time code
1 1     1   1493 use strict;
  1         2  
  1         28  
2 1     1   3 use warnings;
  1         1  
  1         41  
3              
4             package App::Embra::Plugin::Favicon;
5             $App::Embra::Plugin::Favicon::VERSION = '0.001'; # TRIAL
6             # ABSTRACT: adds a favicon
7              
8 1     1   697 use Moo;
  1         12935  
  1         5  
9 1     1   1863 use Method::Signatures;
  1         51354  
  1         6  
10              
11              
12              
13             has 'filename' => (
14             is => 'ro',
15             default => sub { 'favicon.ico' },
16             );
17              
18             has 'file' => (
19             is => 'lazy',
20             default => method {
21             App::Embra::File->new( name => $self->filename )
22             },
23             );
24              
25             has 'fragment' => (
26             is => 'ro',
27             default => method { qq{<link rel="icon" type="image/x-icon" href="${ \ $self->file->name }">} },
28             init_arg => undef,
29             );
30              
31             has 'clipboard' => (
32             is => 'ro',
33             default => 'head',
34             init_arg => undef,
35 1 50   1   1922 );
  1     1   8  
  1         6  
36 1         10  
37             with 'App::Embra::Role::Snippet';
38              
39             method gather_files {
40             $self->add_file( App::Embra::File->new( name => $self->filename ) );
41             }
42              
43             with 'App::Embra::Role::FileGatherer';
44              
45             1;
46              
47             __END__
48              
49             =pod
50              
51             =encoding UTF-8
52              
53             =head1 NAME
54              
55             App::Embra::Plugin::Favicon - adds a favicon
56              
57             =head1 VERSION
58              
59             version 0.001
60              
61             =head1 DESCRIPTION
62              
63             This plugin will add the HTML to the site to include a favicon. You must add the file separately, and then pass the filename to this plugin.
64              
65             =head1 ATTRIBUTES
66              
67             =head2 filename
68              
69             The name of the favicon. Defaults to F<favicon.ico>.
70              
71             =head1 AUTHOR
72              
73             Daniel Holz <dgholz@gmail.com>
74              
75             =head1 COPYRIGHT AND LICENSE
76              
77             This software is copyright (c) 2015 by Daniel Holz.
78              
79             This is free software; you can redistribute it and/or modify it under
80             the same terms as the Perl 5 programming language system itself.
81              
82             =cut