line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::MorningMusume; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
148251
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
80
|
|
4
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
18
|
use Carp qw(croak); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
180
|
|
7
|
3
|
|
|
3
|
|
2734
|
use DateTime; |
|
3
|
|
|
|
|
264303
|
|
|
3
|
|
|
|
|
2546
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
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
|
26
|
my $class = shift; |
77
|
2
|
|
|
|
|
9
|
my $self = bless {members => []}, $class; |
78
|
|
|
|
|
|
|
|
79
|
2
|
|
|
|
|
12
|
$self->_initialize; |
80
|
|
|
|
|
|
|
|
81
|
2
|
|
|
|
|
8
|
return $self; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub members { |
85
|
5
|
|
|
5
|
1
|
1337
|
my ($self, $type, @members) = @_; |
86
|
5
|
50
|
|
|
|
17
|
@members = @{$self->{members}} unless @members; |
|
5
|
|
|
|
|
45
|
|
87
|
|
|
|
|
|
|
|
88
|
5
|
100
|
|
|
|
31
|
return @members unless $type; |
89
|
|
|
|
|
|
|
|
90
|
3
|
100
|
|
|
|
51
|
if ($type eq 'active') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
91
|
1
|
|
|
|
|
3
|
return grep {!$_->graduate_date} @members; |
|
38
|
|
|
|
|
1020
|
|
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
elsif ($type eq 'graduate') { |
94
|
1
|
|
|
|
|
3
|
return grep {$_->graduate_date} @members; |
|
38
|
|
|
|
|
791
|
|
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
elsif ($type->isa('DateTime')) { |
97
|
|
|
|
|
|
|
return grep { |
98
|
1
|
100
|
66
|
|
|
78
|
$date_joined[$_->class] <= $type and |
|
38
|
|
|
|
|
3956
|
|
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
|
|
5
|
my $self = shift; |
131
|
|
|
|
|
|
|
|
132
|
2
|
|
|
|
|
7
|
for my $member (@members) { |
133
|
76
|
|
|
|
|
166
|
my $module_name = 'Acme::MorningMusume::'.$member; |
134
|
|
|
|
|
|
|
|
135
|
76
|
|
|
|
|
5044
|
eval qq|require $module_name;|; |
136
|
76
|
|
|
|
|
248
|
push @{$self->{members}}, $module_name->new; |
|
76
|
|
|
|
|
637
|
|
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
2
|
|
|
|
|
6
|
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__ |