line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PAUSE::Users::UserIterator; |
2
|
|
|
|
|
|
|
$PAUSE::Users::UserIterator::VERSION = '0.08'; |
3
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
47
|
|
5
|
2
|
|
|
2
|
|
21
|
use 5.14.0; |
|
2
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
12
|
use Moo; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
8
|
2
|
|
|
2
|
|
673
|
use PAUSE::Users::User; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
72
|
|
9
|
2
|
|
|
2
|
|
1084
|
use autodie; |
|
2
|
|
|
|
|
30346
|
|
|
2
|
|
|
|
|
11
|
|
10
|
2
|
|
|
2
|
|
13997
|
use feature 'unicode_strings'; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
1275
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'users' => ( is => 'ro' ); |
13
|
|
|
|
|
|
|
has _fh => ( is => 'rw' ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub next_user |
16
|
|
|
|
|
|
|
{ |
17
|
13974
|
|
|
13974
|
0
|
81516
|
my $self = shift; |
18
|
13974
|
|
|
|
|
28883
|
my @fields; |
19
|
|
|
|
|
|
|
my $inuser; |
20
|
13974
|
|
|
|
|
0
|
my $fh; |
21
|
13974
|
|
|
|
|
18872
|
local $_; |
22
|
|
|
|
|
|
|
|
23
|
13974
|
100
|
|
|
|
32080
|
if (not defined $self->_fh) { |
24
|
2
|
|
|
|
|
14
|
$fh = $self->users->open_file(); |
25
|
2
|
|
|
|
|
24047
|
$self->_fh($fh); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
else { |
28
|
13972
|
|
|
|
|
20754
|
$fh = $self->_fh; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
13974
|
|
|
|
|
18232
|
$inuser = 0; |
32
|
|
|
|
|
|
|
LINE: |
33
|
13974
|
|
|
|
|
45455
|
while (<$fh>) { |
34
|
|
|
|
|
|
|
|
35
|
111434
|
100
|
|
|
|
259822
|
if (m!!) { |
36
|
14000
|
|
|
|
|
18930
|
$inuser = 1; |
37
|
14000
|
|
|
|
|
36912
|
next LINE; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
97434
|
100
|
|
|
|
160863
|
next LINE unless $inuser; |
41
|
|
|
|
|
|
|
|
42
|
97270
|
100
|
|
|
|
361091
|
if (m!<([a-zA-Z0-6_]+)>(.*?)\1>!) { |
43
|
83298
|
|
|
|
|
223254
|
my ($field, $value) = ($1, $2); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# author specified a user account |
46
|
|
|
|
|
|
|
# list is a mailing list; we skip those |
47
|
83298
|
100
|
|
|
|
152752
|
if ($field eq 'type') { |
48
|
14000
|
100
|
|
|
|
24390
|
$inuser = 0 if $value eq 'list'; |
49
|
14000
|
|
|
|
|
43978
|
next LINE; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
69298
|
|
|
|
|
132184
|
push(@fields, $field => $value); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
83270
|
100
|
|
|
|
267553
|
if (m!!) { |
56
|
13972
|
|
|
|
|
261842
|
my $user = PAUSE::Users::User->new(@fields); |
57
|
13972
|
|
|
|
|
208019
|
@fields = (); |
58
|
13972
|
|
|
|
|
33982
|
return $user; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
} |
62
|
2
|
|
|
|
|
25
|
close($fh); |
63
|
2
|
|
|
|
|
4165
|
return undef; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |