line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
12
|
|
|
12
|
|
963
|
use 5.006; |
|
12
|
|
|
|
|
29
|
|
|
12
|
|
|
|
|
410
|
|
2
|
12
|
|
|
12
|
|
48
|
use strict; |
|
12
|
|
|
|
|
15
|
|
|
12
|
|
|
|
|
339
|
|
3
|
12
|
|
|
12
|
|
51
|
use warnings; |
|
12
|
|
|
|
|
16
|
|
|
12
|
|
|
|
|
732
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::File::ShareDir::Utils; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.001000'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: Simple utilities for File::ShareDir testing |
12
|
|
|
|
|
|
|
|
13
|
12
|
|
|
12
|
|
46
|
use Exporter 5.57 qw(import); |
|
12
|
|
|
|
|
172
|
|
|
12
|
|
|
|
|
436
|
|
14
|
12
|
|
|
12
|
|
51
|
use Carp qw( croak ); |
|
12
|
|
|
|
|
13
|
|
|
12
|
|
|
|
|
2608
|
|
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
|
14
|
my ( $undashed_to, $source ) = @_; |
43
|
5
|
50
|
33
|
|
|
49
|
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
|
|
|
|
|
32
|
|
47
|
5
|
|
|
|
|
12
|
my $params = {}; |
48
|
5
|
|
|
|
|
15
|
for my $key ( keys %input_config ) { |
49
|
7
|
100
|
|
|
|
40
|
next unless $key =~ /\A-(.*)\z/msx; |
50
|
2
|
|
|
|
|
8
|
$params->{$1} = delete $input_config{$key}; |
51
|
|
|
|
|
|
|
} |
52
|
5
|
50
|
|
|
|
21
|
$params->{$undashed_to} = {} if not exists $params->{$undashed_to}; |
53
|
5
|
|
|
|
|
12
|
for my $key ( keys %input_config ) { |
54
|
5
|
|
|
|
|
16
|
$params->{$undashed_to}->{$key} = $input_config{$key}; |
55
|
|
|
|
|
|
|
} |
56
|
5
|
|
|
|
|
64
|
return $params; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |