line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Format::ModuleList; |
2
|
|
|
|
|
|
|
$Module::Format::ModuleList::VERSION = '0.2.0'; |
3
|
3
|
|
|
3
|
|
55788
|
use warnings; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
86
|
|
4
|
3
|
|
|
3
|
|
14
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
50
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
685
|
use Module::Format::Module; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
890
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
2
|
|
|
2
|
1
|
3
|
my $class = shift; |
13
|
2
|
|
|
|
|
4
|
my $self = bless {}, $class; |
14
|
2
|
|
|
|
|
5
|
$self->_init(@_); |
15
|
2
|
|
|
|
|
4
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _modules |
19
|
|
|
|
|
|
|
{ |
20
|
11
|
|
|
11
|
|
14
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
11
|
100
|
|
|
|
24
|
if (@_) |
23
|
|
|
|
|
|
|
{ |
24
|
2
|
|
|
|
|
5
|
$self->{_modules} = shift; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
11
|
|
|
|
|
26
|
return $self->{_modules}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _add_module |
31
|
|
|
|
|
|
|
{ |
32
|
4
|
|
|
4
|
|
5
|
my ( $self, $module ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
4
|
50
|
|
|
|
12
|
if ( not $module->isa('Module::Format::Module') ) |
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
|
|
0
|
die "Module is " . ref($module) . " instead of Module::Format::Module."; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
4
|
|
|
|
|
5
|
push @{ $self->_modules() }, $module; |
|
4
|
|
|
|
|
6
|
|
40
|
|
|
|
|
|
|
|
41
|
4
|
|
|
|
|
4
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _init |
45
|
|
|
|
|
|
|
{ |
46
|
2
|
|
|
2
|
|
2
|
my ( $self, $args ) = @_; |
47
|
|
|
|
|
|
|
|
48
|
2
|
|
|
|
|
6
|
$self->_modules( [] ); |
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
2
|
foreach my $module ( @{ $args->{modules} } ) |
|
2
|
|
|
|
|
5
|
|
51
|
|
|
|
|
|
|
{ |
52
|
4
|
|
|
|
|
7
|
$self->_add_module($module); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
|
|
3
|
return; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub get_modules_list_copy |
60
|
|
|
|
|
|
|
{ |
61
|
2
|
|
|
2
|
1
|
682
|
my ($self) = @_; |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
|
|
5
|
return [ @{ $self->_modules() } ]; |
|
2
|
|
|
|
|
7
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub format_as |
68
|
|
|
|
|
|
|
{ |
69
|
3
|
|
|
3
|
1
|
893
|
my ( $self, $format ) = @_; |
70
|
|
|
|
|
|
|
|
71
|
3
|
|
|
|
|
8
|
return [ map { $_->format_as($format) } @{ $self->_modules() } ]; |
|
6
|
|
|
|
|
21
|
|
|
3
|
|
|
|
|
8
|
|
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub sane_from_guesses |
76
|
|
|
|
|
|
|
{ |
77
|
1
|
|
|
1
|
1
|
498
|
my ( $class, $args ) = @_; |
78
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
4
|
my @modules; |
80
|
|
|
|
|
|
|
|
81
|
1
|
|
|
|
|
2
|
foreach my $string ( @{ $args->{'values'} } ) |
|
1
|
|
|
|
|
4
|
|
82
|
|
|
|
|
|
|
{ |
83
|
2
|
|
|
|
|
10
|
my $module = Module::Format::Module->from_guess( { value => $string } ); |
84
|
|
|
|
|
|
|
|
85
|
2
|
50
|
|
|
|
8
|
if ( !$module->is_sane() ) |
86
|
|
|
|
|
|
|
{ |
87
|
0
|
|
|
|
|
0
|
die "Value '$string' does not evaluate as a sane module."; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
2
|
|
|
|
|
7
|
push @modules, $module; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
1
|
|
|
|
|
4
|
return $class->new( { modules => \@modules } ); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; # End of Module::Format::ModuleList |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |