line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Types::OPM; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: OPM related types |
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
204270
|
use v5.10; |
|
9
|
|
|
|
|
45
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
60
|
use strict; |
|
9
|
|
|
|
|
34
|
|
|
9
|
|
|
|
|
184
|
|
8
|
9
|
|
|
9
|
|
41
|
use warnings; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
353
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Type::Library |
11
|
9
|
|
|
|
|
86
|
-base, |
12
|
9
|
|
|
9
|
|
1521
|
-declare => qw(OPMVersion OPMVersionWildcard OPMFile); |
|
9
|
|
|
|
|
113226
|
|
13
|
|
|
|
|
|
|
|
14
|
9
|
|
|
9
|
|
15427
|
use Type::Utils -all; |
|
9
|
|
|
|
|
31144
|
|
|
9
|
|
|
|
|
97
|
|
15
|
9
|
|
|
9
|
|
30065
|
use Types::Standard -types; |
|
9
|
|
|
|
|
665268
|
|
|
9
|
|
|
|
|
114
|
|
16
|
9
|
|
|
9
|
|
83517
|
use OPM::Parser; |
|
9
|
|
|
|
|
2299150
|
|
|
9
|
|
|
|
|
3112
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
declare OPMVersion => |
19
|
|
|
|
|
|
|
as Str, |
20
|
|
|
|
|
|
|
where { |
21
|
|
|
|
|
|
|
$_ =~ m{ \A (?: [0-9]+ \. ){2} (?: [0-9]+ ) \z }xms |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
declare OPMVersionWildcard => |
25
|
|
|
|
|
|
|
as Str, |
26
|
|
|
|
|
|
|
where { |
27
|
|
|
|
|
|
|
$_ =~ m{ |
28
|
|
|
|
|
|
|
\A (?: |
29
|
|
|
|
|
|
|
(?: [0-9]+ \. ){2} (?: [0-9]+ ) | |
30
|
|
|
|
|
|
|
(?: [0-9]+ \. ){1,2} x |
31
|
|
|
|
|
|
|
) \z |
32
|
|
|
|
|
|
|
}xms |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
declare OPMFile => |
36
|
|
|
|
|
|
|
as InstanceOf['OPM::Parser'], |
37
|
|
|
|
|
|
|
where { |
38
|
|
|
|
|
|
|
$_->opm_file =~ m{\.s?opm\z} and $_->error_string eq ''; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
coerce OPMFile => |
43
|
|
|
|
|
|
|
from Str, |
44
|
|
|
|
|
|
|
via { |
45
|
|
|
|
|
|
|
return if !-f $_; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
my $p = OPM::Parser->new( opm_file => $_ ); |
48
|
|
|
|
|
|
|
$p->parse; |
49
|
|
|
|
|
|
|
$p; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=pod |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=encoding UTF-8 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 NAME |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Types::OPM - OPM related types |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 VERSION |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
version 0.10 |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 TYPES |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 OPMVersion |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
An OPM version looks like 2.4.5 or 6.0.1. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 OPMVersionWildcard |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
An OPM version with wildcard as used in Addons. To define a version of the OPM framework |
78
|
|
|
|
|
|
|
that is needed to install the addon, the developer can use 'x' as a wildcard. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
E.g. Addons for OPM 6.x can be installed on any OPM 6 installation, whilst addons that |
81
|
|
|
|
|
|
|
define 2.4.x as the framework version can only installed on any OPM 2.4 installation, but |
82
|
|
|
|
|
|
|
not on OPM 2.3 installation. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 OPMFile |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
An object of L<OPM::Parser>. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
It checks if the file exists and can be parsed without an error. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 COERCIONS |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 OPMFile |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=over 4 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * From String to OPM::Parser |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
When a string is given, it is coerced into an L<OPM::Parser> object. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=back |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 AUTHOR |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Renee Baecker <reneeb@cpan.org> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This software is Copyright (c) 2019 by Renee Baecker. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This is free software, licensed under: |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=cut |