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