line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Types::Common; # git description: v0.001012-15-ge054d66 |
2
|
|
|
|
|
|
|
# ABSTRACT: A library of commonly used type constraints |
3
|
|
|
|
|
|
|
our $VERSION = '0.001013'; |
4
|
1
|
|
|
1
|
|
796
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
5
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
97
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub import { |
9
|
2
|
|
|
2
|
|
13037
|
my $self = shift; |
10
|
2
|
100
|
|
|
|
13
|
return unless @_; |
11
|
1
|
|
|
|
|
351
|
Carp::cluck("Tried to import the symbols " . join(', ', @_) |
12
|
|
|
|
|
|
|
. " from MooseX::Types::Common.\nDid you mean " |
13
|
|
|
|
|
|
|
. "MooseX::Types::Common::String or MooseX::Type::Common::Numeric?"); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
1; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
__END__ |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=pod |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=encoding UTF-8 |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
MooseX::Types::Common - A library of commonly used type constraints |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 VERSION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
version 0.001013 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
use MooseX::Types::Common::String qw/SimpleStr/; |
35
|
|
|
|
|
|
|
has short_str => (is => 'rw', isa => SimpleStr); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
... |
38
|
|
|
|
|
|
|
#this will fail |
39
|
|
|
|
|
|
|
$object->short_str("string\nwith\nbreaks"); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use MooseX::Types::Common::Numeric qw/PositiveInt/; |
43
|
|
|
|
|
|
|
has count => (is => 'rw', isa => PositiveInt); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
... |
46
|
|
|
|
|
|
|
#this will fail |
47
|
|
|
|
|
|
|
$object->count(-33); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 DESCRIPTION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
A set of commonly-used type constraints that do not ship with Moose by default. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SEE ALSO |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=over |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item * L<MooseX::Types::Common::String> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item * L<MooseX::Types::Common::Numeric> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item * L<MooseX::Types> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * L<Moose::Util::TypeConstraints> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 ORIGIN |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This distribution was extracted from the L<Reaction> code base by Guillermo |
70
|
|
|
|
|
|
|
Roditi (groditi). |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHORS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over 4 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>) |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
K. James Cheetham <jamie@shadowcatsystems.co.uk> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Guillermo Roditi <groditi@gmail.com> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>). |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
95
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 CONTRIBUTORS |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=for stopwords Karen Etheridge Justin Hunter Dave Rolsky Tomas Doran Graham Knop Denis Ibaev |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=over 4 |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item * |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item * |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Justin Hunter <justin.d.hunter@gmail.com> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item * |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item * |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Tomas Doran <bobtfish@bobtfish.net> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item * |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Graham Knop <haarg@haarg.org> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item * |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Denis Ibaev <dionys@gmail.com> |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=back |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=cut |