File Coverage

blib/lib/Plack/App/CPAN/Changes.pm
Criterion Covered Total %
statement 31 31 100.0
branch 6 6 100.0
condition n/a
subroutine 8 8 100.0
pod n/a
total 45 45 100.0


line stmt bran cond sub pod time code
1             package Plack::App::CPAN::Changes;
2              
3 3     3   569890 use base qw(Plack::Component::Tags::HTML);
  3         5  
  3         2125  
4 3     3   274514 use strict;
  3         7  
  3         91  
5 3     3   18 use warnings;
  3         6  
  3         185  
6              
7 3     3   17 use Plack::Util::Accessor qw(changes generator title);
  3         9  
  3         28  
8 3     3   2272 use Tags::HTML::CPAN::Changes 0.06;
  3         65191  
  3         1010  
9              
10             our $VERSION = 0.05;
11              
12             sub _css {
13 4     4   3828 my ($self, $env) = @_;
14              
15 4         27 $self->{'_tags_changes'}->process_css;
16              
17 4         4672 return;
18             }
19              
20             sub _prepare_app {
21 4     4   415792 my $self = shift;
22              
23             # Defaults which rewrite defaults in module which I am inheriting.
24 4 100       20 if (! defined $self->generator) {
25 3         48 $self->generator(__PACKAGE__.'; Version: '.$VERSION);
26             }
27              
28 4 100       92 if (! defined $self->title) {
29 3         24 $self->title('Changes');
30             }
31              
32             # Inherite defaults.
33 4         48 $self->SUPER::_prepare_app;
34              
35             # Defaults from this module.
36 4         1092 $self->{'_tags_changes'} = Tags::HTML::CPAN::Changes->new(
37             'css' => $self->css,
38             'tags' => $self->tags,
39             );
40              
41             # Set CPAN::Changes object to present.
42 4 100       778 if (defined $self->changes) {
43 3         28 $self->{'_tags_changes'}->init($self->changes);
44             }
45              
46 4         357 return;
47             }
48              
49             sub _tags_middle {
50 4     4   22181 my ($self, $env) = @_;
51              
52 4         27 $self->{'_tags_changes'}->process;
53              
54 4         4294 return;
55             }
56              
57             1;
58              
59             __END__