line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Types::PerlVersion; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: L<Perl::Version> type for Moose classes |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
578434
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
50
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.002'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
850
|
use MooseX::Types -declare => [qw(PerlVersion)]; |
|
1
|
|
|
|
|
245633
|
|
|
1
|
|
|
|
|
8
|
|
11
|
1
|
|
|
1
|
|
5570
|
use MooseX::Types::Moose qw(Num Str); |
|
1
|
|
|
|
|
17047
|
|
|
1
|
|
|
|
|
14
|
|
12
|
1
|
|
|
1
|
|
7145
|
use Perl::Version; |
|
1
|
|
|
|
|
3038
|
|
|
1
|
|
|
|
|
29
|
|
13
|
1
|
|
|
1
|
|
7
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
class_type 'Perl::Version'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
subtype PerlVersion, |
18
|
|
|
|
|
|
|
as 'Perl::Version', |
19
|
|
|
|
|
|
|
where { $_ =~ Perl::Version::REGEX }, |
20
|
|
|
|
|
|
|
message { 'Must be a valid Perl version' }; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
coerce PerlVersion, |
23
|
|
|
|
|
|
|
from Num, via { Perl::Version->new($_) }, |
24
|
|
|
|
|
|
|
from Str, via { Perl::Version->new($_) }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; # eof |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
MooseX::Types::PerlVersion - L<Perl::Version> type for Moose classes |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
version 0.002 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use MooseX::Types::PerlVersion qw(PerlVersion); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has version => ( |
45
|
|
|
|
|
|
|
is => 'ro', |
46
|
|
|
|
|
|
|
isa => PerlVersion, |
47
|
|
|
|
|
|
|
coerce => 1, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
This package provides Moose types for L<Perl::Version>. It also provides |
53
|
|
|
|
|
|
|
coercion from C<Str> and C<Num> Moose types. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 EXPORT |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
None by default, you'll usually want to request C<PerlVersion> explicitly. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SEE ALSO |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=over 4 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item L<Perl::Version> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item L<Moose::Util::TypeConstraints> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item L<Moose> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=back |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Roman F. <romanf@cpan.org> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Roman F.. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
82
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |