line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::MorningMusume; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
85636
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
64
|
|
4
|
3
|
|
|
3
|
|
9
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
10
|
use Carp qw(croak); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
124
|
|
7
|
3
|
|
|
3
|
|
1457
|
use DateTime; |
|
3
|
|
|
|
|
136499
|
|
|
3
|
|
|
|
|
1360
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.20'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @members = qw( |
12
|
|
|
|
|
|
|
FukudaAsuka |
13
|
|
|
|
|
|
|
NakazawaYuko |
14
|
|
|
|
|
|
|
IidaKaori |
15
|
|
|
|
|
|
|
AbeNatsumi |
16
|
|
|
|
|
|
|
IshiguroAya |
17
|
|
|
|
|
|
|
IchiiSayaka |
18
|
|
|
|
|
|
|
YaguchiMari |
19
|
|
|
|
|
|
|
YasudaKei |
20
|
|
|
|
|
|
|
GotohMaki |
21
|
|
|
|
|
|
|
IshikawaRika |
22
|
|
|
|
|
|
|
YoshizawaHitomi |
23
|
|
|
|
|
|
|
TsujiNozomi |
24
|
|
|
|
|
|
|
KagoAi |
25
|
|
|
|
|
|
|
TakahashiAi |
26
|
|
|
|
|
|
|
KonnoAsami |
27
|
|
|
|
|
|
|
OgawaMakoto |
28
|
|
|
|
|
|
|
NiigakiRisa |
29
|
|
|
|
|
|
|
KameiEri |
30
|
|
|
|
|
|
|
TanakaReina |
31
|
|
|
|
|
|
|
MichishigeSayumi |
32
|
|
|
|
|
|
|
FujimotoMiki |
33
|
|
|
|
|
|
|
KusumiKoharu |
34
|
|
|
|
|
|
|
MitsuiAika |
35
|
|
|
|
|
|
|
LiChun |
36
|
|
|
|
|
|
|
QianLin |
37
|
|
|
|
|
|
|
SuzukiKanon |
38
|
|
|
|
|
|
|
IkutaErina |
39
|
|
|
|
|
|
|
FukumuraMizuki |
40
|
|
|
|
|
|
|
SayashiRiho |
41
|
|
|
|
|
|
|
IikuboHaruna |
42
|
|
|
|
|
|
|
IshidaAyumi |
43
|
|
|
|
|
|
|
SatohMasaki |
44
|
|
|
|
|
|
|
KudohHaruka |
45
|
|
|
|
|
|
|
OdaSakura |
46
|
|
|
|
|
|
|
OgataHaruna |
47
|
|
|
|
|
|
|
NonakaMiki |
48
|
|
|
|
|
|
|
MakinoMaria |
49
|
|
|
|
|
|
|
HagaAkane |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my @date_joined = map { |
53
|
|
|
|
|
|
|
my ($year, $month, $day) = ($_ =~ /(\d{4})-(\d{2})-(\d{2})/); |
54
|
|
|
|
|
|
|
DateTime->new( |
55
|
|
|
|
|
|
|
year => $year, |
56
|
|
|
|
|
|
|
month => $month, |
57
|
|
|
|
|
|
|
day => $day, |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
} qw( |
60
|
|
|
|
|
|
|
1997-09-07 |
61
|
|
|
|
|
|
|
1998-05-03 |
62
|
|
|
|
|
|
|
1999-08-04 |
63
|
|
|
|
|
|
|
2000-04-16 |
64
|
|
|
|
|
|
|
2001-08-26 |
65
|
|
|
|
|
|
|
2003-01-19 |
66
|
|
|
|
|
|
|
2005-05-01 |
67
|
|
|
|
|
|
|
2006-12-10 |
68
|
|
|
|
|
|
|
2011-01-02 |
69
|
|
|
|
|
|
|
2011-09-29 |
70
|
|
|
|
|
|
|
2012-09-14 |
71
|
|
|
|
|
|
|
2014-09-30 |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
unshift @date_joined, undef; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub new { |
76
|
2
|
|
|
2
|
1
|
23
|
my $class = shift; |
77
|
2
|
|
|
|
|
7
|
my $self = bless {members => []}, $class; |
78
|
|
|
|
|
|
|
|
79
|
2
|
|
|
|
|
7
|
$self->_initialize; |
80
|
|
|
|
|
|
|
|
81
|
2
|
|
|
|
|
4
|
return $self; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub members { |
85
|
5
|
|
|
5
|
1
|
687
|
my ($self, $type, @members) = @_; |
86
|
5
|
50
|
|
|
|
15
|
@members = @{$self->{members}} unless @members; |
|
5
|
|
|
|
|
26
|
|
87
|
|
|
|
|
|
|
|
88
|
5
|
100
|
|
|
|
19
|
return @members unless $type; |
89
|
|
|
|
|
|
|
|
90
|
3
|
100
|
|
|
|
35
|
if ($type eq 'active') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
91
|
1
|
|
|
|
|
2
|
return grep {!$_->graduate_date} @members; |
|
38
|
|
|
|
|
585
|
|
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
elsif ($type eq 'graduate') { |
94
|
1
|
|
|
|
|
2
|
return grep {$_->graduate_date} @members; |
|
38
|
|
|
|
|
446
|
|
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
elsif ($type->isa('DateTime')) { |
97
|
|
|
|
|
|
|
return grep { |
98
|
1
|
100
|
66
|
|
|
54
|
$date_joined[$_->class] <= $type and |
|
38
|
|
|
|
|
2259
|
|
99
|
|
|
|
|
|
|
(!$_->graduate_date or $type <= $_->graduate_date) |
100
|
|
|
|
|
|
|
} @members; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub sort { |
105
|
0
|
|
|
0
|
1
|
0
|
my ($self, $type, $order, @members) = @_; |
106
|
0
|
0
|
|
|
|
0
|
@members = $self->members unless @members; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
# order by desc if $order is true |
109
|
0
|
0
|
|
|
|
0
|
if ($order) { |
110
|
0
|
|
|
|
|
0
|
return sort {$b->$type <=> $a->$type} @members; |
|
0
|
|
|
|
|
0
|
|
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
else { |
113
|
0
|
|
|
|
|
0
|
return sort {$a->$type <=> $b->$type} @members; |
|
0
|
|
|
|
|
0
|
|
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub select { |
118
|
0
|
|
|
0
|
1
|
0
|
my ($self, $type, $number, $operator, @members) = @_; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
$self->_die('invalid operator was passed in') |
121
|
0
|
0
|
|
|
|
0
|
unless grep {$operator eq $_} qw(== >= <= > <); |
|
0
|
|
|
|
|
0
|
|
122
|
|
|
|
|
|
|
|
123
|
0
|
0
|
|
|
|
0
|
@members = $self->members unless @members; |
124
|
0
|
|
|
|
|
0
|
my $compare = eval "(sub { \$number $operator \$_[0] })"; |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
0
|
return grep { $compare->($_->$type) } @members; |
|
0
|
|
|
|
|
0
|
|
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub _initialize { |
130
|
2
|
|
|
2
|
|
4
|
my $self = shift; |
131
|
|
|
|
|
|
|
|
132
|
2
|
|
|
|
|
4
|
for my $member (@members) { |
133
|
76
|
|
|
|
|
119
|
my $module_name = 'Acme::MorningMusume::'.$member; |
134
|
|
|
|
|
|
|
|
135
|
76
|
|
|
|
|
3985
|
eval qq|require $module_name;|; |
136
|
76
|
|
|
|
|
168
|
push @{$self->{members}}, $module_name->new; |
|
76
|
|
|
|
|
451
|
|
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
2
|
|
|
|
|
4
|
return 1; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub _die { |
143
|
0
|
|
|
0
|
|
|
my ($self, $message) = @_; |
144
|
0
|
|
|
|
|
|
Carp::croak($message); |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
1; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
__END__ |