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