line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Types::Dist; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Types related to distributions (e.g. distributions on CPAN) |
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
11855
|
use v5.10; |
|
9
|
|
|
|
|
34
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
49
|
use strict; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
196
|
|
8
|
9
|
|
|
9
|
|
43
|
use warnings; |
|
9
|
|
|
|
|
25
|
|
|
9
|
|
|
|
|
401
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Type::Library |
11
|
9
|
|
|
|
|
70
|
-base, |
12
|
9
|
|
|
9
|
|
1408
|
-declare => qw( DistName DistVersion DistFQ CPANfile ); |
|
9
|
|
|
|
|
77356
|
|
13
|
|
|
|
|
|
|
|
14
|
9
|
|
|
9
|
|
10748
|
use Type::Utils -all; |
|
9
|
|
|
|
|
13933
|
|
|
9
|
|
|
|
|
81
|
|
15
|
9
|
|
|
9
|
|
31200
|
use Types::Standard -types; |
|
9
|
|
|
|
|
133687
|
|
|
9
|
|
|
|
|
77
|
|
16
|
|
|
|
|
|
|
|
17
|
9
|
|
|
9
|
|
45196
|
use Module::CPANfile; |
|
9
|
|
|
|
|
127251
|
|
|
9
|
|
|
|
|
2435
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $distname_re = qr{ |
22
|
|
|
|
|
|
|
(?:[A-Za-z][A-Za-z0-9]*) |
23
|
|
|
|
|
|
|
(?: - [A-Za-z0-9]+ )* |
24
|
|
|
|
|
|
|
}xms; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $distversion_re = qr{ |
27
|
|
|
|
|
|
|
v? |
28
|
|
|
|
|
|
|
(?: |
29
|
|
|
|
|
|
|
[0-9]+ |
30
|
|
|
|
|
|
|
(?: \. [0-9]+ )* |
31
|
|
|
|
|
|
|
) |
32
|
|
|
|
|
|
|
}xms; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $distfq_re = qr{$distname_re-$distversion_re}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
declare DistName => |
38
|
|
|
|
|
|
|
as Str, |
39
|
|
|
|
|
|
|
where { $_ =~ m{\A$distname_re\z} }; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
declare DistVersion => |
42
|
|
|
|
|
|
|
as Str, |
43
|
|
|
|
|
|
|
where { $_ =~ m{\A$distversion_re\z} }; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
declare DistFQ => |
46
|
|
|
|
|
|
|
as Str, |
47
|
|
|
|
|
|
|
where { $_ =~ m{\A$distfq_re\z} }; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
class_type CPANfile, { class => 'Module::CPANfile' }; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
coerce CPANfile, |
52
|
|
|
|
|
|
|
from Str, via { Module::CPANfile->load( $_ ) } |
53
|
|
|
|
|
|
|
; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |