line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bootylicious::ArticleArchiveSimple; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
113
|
|
4
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
83
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
16
|
use base 'Mojo::Base'; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
204
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
22
|
use Bootylicious::Iterator; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
26
|
|
9
|
4
|
|
|
4
|
|
80
|
use Bootylicious::Year; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
19
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->attr('articles'); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
1
|
|
|
1
|
1
|
6
|
my $self = shift->SUPER::new(@_); |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
9
|
return $self->build; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub build { |
20
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
3
|
my @archive = (); |
23
|
1
|
|
|
|
|
4
|
while (my $article = $self->articles->next) { |
24
|
0
|
|
|
|
|
0
|
my $year = $article->created->year; |
25
|
0
|
|
|
|
|
0
|
my $month = $article->created->month; |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
0
|
|
|
0
|
push @archive, [$year, $month] |
|
|
|
0
|
|
|
|
|
28
|
|
|
|
|
|
|
if !@archive |
29
|
|
|
|
|
|
|
|| ($archive[-1]->[0] != $year || $archive[-1]->[1] != $month); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
5
|
return [@archive]; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |