line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
12
|
|
|
12
|
|
879
|
use 5.006; |
|
12
|
|
|
|
|
31
|
|
|
12
|
|
|
|
|
401
|
|
2
|
12
|
|
|
12
|
|
51
|
use strict; |
|
12
|
|
|
|
|
15
|
|
|
12
|
|
|
|
|
313
|
|
3
|
12
|
|
|
12
|
|
48
|
use warnings; |
|
12
|
|
|
|
|
15
|
|
|
12
|
|
|
|
|
812
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::File::ShareDir::Utils; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.001001'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Simple utilities for File::ShareDir testing |
12
|
|
|
|
|
|
|
|
13
|
12
|
|
|
12
|
|
52
|
use Exporter 5.57 qw(import); |
|
12
|
|
|
|
|
181
|
|
|
12
|
|
|
|
|
476
|
|
14
|
12
|
|
|
12
|
|
53
|
use Carp qw( croak ); |
|
12
|
|
|
|
|
16
|
|
|
12
|
|
|
|
|
2886
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @EXPORT_OK = qw( extract_dashes ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub extract_dashes { |
42
|
5
|
|
|
5
|
1
|
13
|
my ( $undashed_to, $source ) = @_; |
43
|
5
|
50
|
33
|
|
|
47
|
if ( not ref $source or 'HASH' ne ref $source ) { |
44
|
0
|
|
|
|
|
0
|
return croak(q[Must pass a hashref]); |
45
|
|
|
|
|
|
|
} |
46
|
5
|
|
|
|
|
10
|
my %input_config = %{$source}; |
|
5
|
|
|
|
|
20
|
|
47
|
5
|
|
|
|
|
12
|
my $params = {}; |
48
|
5
|
|
|
|
|
15
|
for my $key ( keys %input_config ) { |
49
|
7
|
100
|
|
|
|
37
|
next unless $key =~ /\A-(.*)\z/msx; |
50
|
2
|
|
|
|
|
12
|
$params->{$1} = delete $input_config{$key}; |
51
|
|
|
|
|
|
|
} |
52
|
5
|
50
|
|
|
|
29
|
$params->{$undashed_to} = {} if not exists $params->{$undashed_to}; |
53
|
5
|
|
|
|
|
12
|
for my $key ( keys %input_config ) { |
54
|
5
|
|
|
|
|
13
|
$params->{$undashed_to}->{$key} = $input_config{$key}; |
55
|
|
|
|
|
|
|
} |
56
|
5
|
|
|
|
|
59
|
return $params; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |