Plagger/Plugin/SmartFeed/All.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 36 CC 3 SCAR 15.4
CC
3
Cov
0%
feed_init
6.0
feed_finalize
6.0
BEGIN
2.0
CRAP 4.7
1 package Plagger::Plugin::SmartFeed::All;
2 use strict;
3 use base qw( Plagger::Plugin::SmartFeed );
4  
5 sub feed_init {
6 my($self, $context, $args) = @_;
7  
8 my $feed = Plagger::Feed->new;
9 $feed->type('smartfeed');
10 $feed->id( $self->conf->{id} || ('smartfeed:all') );
11 $feed->title( $self->conf->{title} || "All Entries" );
12 $feed->link( $self->conf->{link} );
13 $feed->description( $self->conf->{description} ) if $self->conf->{description};
14  
15 $self->{feed} = $feed;
16 }
17  
18 sub feed_finalize {
19 my($self, $context, $args) = @_;
20  
21 # because it's "All" you have to dedupe the entries
22 $self->{feed}->dedupe_entries;
23 $self->{feed}->sort_entries;
24  
25 $context->update->add($self->{feed}) if $self->{feed}->count;
26 }
27  
28 1;
29