File Coverage

lib/User/Information/Source.pm
Criterion Covered Total %
statement 13 20 65.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 5 7 71.4
pod n/a
total 18 32 56.2


line stmt bran cond sub pod time code
1             # Copyright (c) 2025 Philipp Schafft
2              
3             # licensed under Artistic License 2.0 (see LICENSE file)
4              
5             # ABSTRACT: generic module for extracting information from user accounts
6              
7              
8             package User::Information::Source;
9              
10 1     1   12 use v5.20;
  1         2  
11 1     1   5 use strict;
  1         2  
  1         24  
12 1     1   3 use warnings;
  1         2  
  1         46  
13              
14 1     1   3 use Carp;
  1         1  
  1         225  
15              
16             our $VERSION = v0.05;
17              
18             # ---- Private helpers ----
19             sub import {
20 1     1   2 my ($pkg, @args) = @_;
21              
22 1         20 foreach my $mod (@args) {
23 0 0 0       if ($mod =~ /^User::Information::Source:/ && $mod =~ s#::#/#g) {
24 0           require $mod.'.pm';
25             }
26             }
27             }
28              
29             sub _discover {
30 0     0     my ($pkg, $base, %opts) = @_;
31 0           croak 'BUG: Not implemented';
32             }
33              
34             sub _load {
35 0     0     my ($pkg, $source, $base, %opts) = @_;
36 0           $pkg->import($source);
37 0           return $source->_discover($base, %opts);
38             }
39              
40             1;
41              
42             __END__