| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Types::OTRS; |
|
2
|
|
|
|
|
|
|
$Types::OTRS::VERSION = '0.09'; |
|
3
|
|
|
|
|
|
|
# ABSTRACT: OTRS related types |
|
4
|
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
204218
|
use v5.10; |
|
|
9
|
|
|
|
|
44
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
52
|
use strict; |
|
|
9
|
|
|
|
|
18
|
|
|
|
9
|
|
|
|
|
224
|
|
|
8
|
9
|
|
|
9
|
|
51
|
use warnings; |
|
|
9
|
|
|
|
|
35
|
|
|
|
9
|
|
|
|
|
362
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Type::Library |
|
11
|
9
|
|
|
|
|
78
|
-base, |
|
12
|
9
|
|
|
9
|
|
1733
|
-declare => qw(OTRSVersion OTRSVersionWildcard OPMFile); |
|
|
9
|
|
|
|
|
105185
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
9
|
|
|
9
|
|
13950
|
use Type::Utils -all; |
|
|
9
|
|
|
|
|
27478
|
|
|
|
9
|
|
|
|
|
116
|
|
|
15
|
9
|
|
|
9
|
|
26605
|
use Types::Standard -types; |
|
|
9
|
|
|
|
|
612454
|
|
|
|
9
|
|
|
|
|
136
|
|
|
16
|
9
|
|
|
9
|
|
54287
|
use OTRS::OPM::Parser; |
|
|
9
|
|
|
|
|
2735825
|
|
|
|
9
|
|
|
|
|
3432
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
declare OTRSVersion => |
|
19
|
|
|
|
|
|
|
as Str, |
|
20
|
|
|
|
|
|
|
where { |
|
21
|
|
|
|
|
|
|
$_ =~ m{ \A (?: [0-9]+ \. ){2} (?: [0-9]+ ) \z }xms |
|
22
|
|
|
|
|
|
|
}; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
declare OTRSVersionWildcard => |
|
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['OTRS::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 = OTRS::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::OTRS - OTRS related types |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 VERSION |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
version 0.09 |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 TYPES |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 OTRSVersion |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
An OTRS version looks like 2.4.5 or 6.0.1. |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 OTRSVersionWildcard |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
An OTRS version with wildcard as used in Addons. To define a version of the OTRS framework |
|
78
|
|
|
|
|
|
|
that is needed to install the addon, the developer can use 'x' as a wildcard. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
E.g. Addons for OTRS 6.x can be installed on any OTRS 6 installation, whilst addons that |
|
81
|
|
|
|
|
|
|
define 2.4.x as the framework version can only installed on any OTRS 2.4 installation, but |
|
82
|
|
|
|
|
|
|
not on OTRS 2.3 installation. |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 OPMFile |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
An object of L<OTRS::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 OTRS::OPM::Parser |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
When a string is given, it is coerced into an L<OTRS::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 |