line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Module::Spec; |
3
|
|
|
|
|
|
|
$Module::Spec::VERSION = '0.9.0'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Load modules based on specifications |
5
|
1
|
|
|
1
|
|
719
|
use 5.012; |
|
1
|
|
|
|
|
13
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# use warnings; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN { |
10
|
1
|
|
|
1
|
|
6
|
require Module::Spec::V0; |
11
|
1
|
|
|
|
|
144
|
*croak = \&Module::Spec::V0::croak; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
croak qq{What version?} unless exists $args{ver}; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $v = $args{ver}; |
20
|
0
|
0
|
0
|
|
|
|
unless ( defined $v && $v =~ /\A[1-9][0-9]*\z/ ) { |
21
|
0
|
0
|
|
|
|
|
croak qq{Invalid version ($v)} if defined $v; |
22
|
0
|
|
|
|
|
|
croak qq{Undefined version}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
require Module::Spec::OO; |
26
|
0
|
|
|
|
|
|
return bless {}, Module::Spec::OO->create_class($v); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#pod =encoding utf8 |
32
|
|
|
|
|
|
|
#pod |
33
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
34
|
|
|
|
|
|
|
#pod |
35
|
|
|
|
|
|
|
#pod use Module::Spec; |
36
|
|
|
|
|
|
|
#pod |
37
|
|
|
|
|
|
|
#pod my $ms = Module::Spec->new(ver => 2); |
38
|
|
|
|
|
|
|
#pod $ms->need_module('Mango~2.3'); |
39
|
|
|
|
|
|
|
#pod |
40
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
41
|
|
|
|
|
|
|
#pod |
42
|
|
|
|
|
|
|
#pod B |
43
|
|
|
|
|
|
|
#pod |
44
|
|
|
|
|
|
|
#pod =cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |