Skip to content

Commit b716024

Browse files
committed
Ingest: read_06perms_iter - supprort alternative file (for testing)
1 parent 37b9e90 commit b716024

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/MetaCPAN/Ingest.pm

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,16 @@ sub read_06perms_fh ( $file = undef ) {
375375
return $cpan->child(qw< modules 06perms.txt >)->openr;
376376
}
377377

378-
sub read_06perms_iter () {
379-
my $cpan = cpan_dir();
380-
my $file_path = $cpan->child(qw< modules 06perms.txt >)->absolute;
381-
my $pp = PAUSE::Permissions->new( path => $file_path );
378+
sub read_06perms_iter ( $file = undef ) {
379+
my $file_path;
380+
if ( $file ) {
381+
$file_path = path($file)->absolute;
382+
} else {
383+
my $cpan = cpan_dir();
384+
$file_path = $cpan->child(qw< modules 06perms.txt >)->absolute;
385+
}
386+
387+
my $pp = PAUSE::Permissions->new( path => $file_path );
382388
return $pp->module_iterator;
383389
}
384390

0 commit comments

Comments
 (0)