line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PAUSE::Permissions::EntryIterator; |
2
|
|
|
|
|
|
|
$PAUSE::Permissions::EntryIterator::VERSION = '0.14'; |
3
|
6
|
|
|
6
|
|
23
|
use strict; |
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
195
|
|
4
|
6
|
|
|
6
|
|
20
|
use warnings; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
151
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
16
|
use Moo; |
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
26
|
|
7
|
6
|
|
|
6
|
|
3105
|
use PAUSE::Permissions::Entry; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
152
|
|
8
|
6
|
|
|
6
|
|
30
|
use autodie; |
|
6
|
|
|
|
|
4
|
|
|
6
|
|
|
|
|
29
|
|
9
|
6
|
|
|
6
|
|
18433
|
use feature 'state'; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
1635
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has 'permissions' => |
12
|
|
|
|
|
|
|
( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
# isa => 'PAUSE::Permissions', |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub next |
18
|
|
|
|
|
|
|
{ |
19
|
13
|
|
|
13
|
0
|
1902
|
my $self = shift; |
20
|
13
|
|
|
|
|
10
|
state $fh; |
21
|
|
|
|
|
|
|
|
22
|
13
|
100
|
|
|
|
24
|
if (not defined $fh) { |
23
|
1
|
|
|
|
|
10
|
open($fh, '<', $self->permissions->path); |
24
|
1
|
|
|
|
|
1374
|
my $inheader = 1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Skip the header block at the top of the file |
27
|
1
|
|
|
|
|
14
|
while (<$fh>) { |
28
|
3
|
100
|
|
|
|
9
|
last if /^$/; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
13
|
|
|
|
|
21
|
my $line = <$fh>; |
33
|
|
|
|
|
|
|
|
34
|
13
|
100
|
|
|
|
16
|
if (defined($line)) { |
35
|
12
|
|
|
|
|
11
|
chomp($line); |
36
|
12
|
|
|
|
|
22
|
my ($module, $user, $permission) = split(/,/, $line); |
37
|
12
|
|
|
|
|
144
|
return PAUSE::Permissions::Entry->new(module => $module, user => $user, permission => $permission); |
38
|
|
|
|
|
|
|
} else { |
39
|
1
|
|
|
|
|
2
|
return undef; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |