line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OurCal::Todo; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1064
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
296
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
OurCal::Todo - a TODO class for OurCal |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 METHODS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head2 new |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Requires a description param and optionally a for and an id param. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
0
|
|
|
0
|
1
|
|
my ($class, %todo) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return bless \%todo, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 id |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
The id of the TODO |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub id { |
35
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
36
|
0
|
|
|
|
|
|
return $self->{id}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 description |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The description of the TODO |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub description { |
46
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
return $self->_trim($self->{description}); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 for |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Who the TODO is for |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub for { |
57
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
return $self->{for}; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 full_description |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
The Description plus the for if it's present |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub full_description { |
69
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
70
|
0
|
|
|
|
|
|
my $for = $self->{for}; |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
my $description; |
73
|
0
|
0
|
|
|
|
|
if (defined $for) { |
74
|
0
|
|
|
|
|
|
$description = sprintf "(%s) %s", $for, $self->description; |
75
|
|
|
|
|
|
|
} else { |
76
|
0
|
|
|
|
|
|
$description = sprintf "%s", $self->description; |
77
|
|
|
|
|
|
|
} |
78
|
0
|
|
|
|
|
|
return $description; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub _trim { |
82
|
0
|
|
|
0
|
|
|
my($self, $text) = @_; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
$text =~ s/^\s*(.+=?)\$/$1/; |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
return $text; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|