line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Reindeer |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is Copyright (c) 2017, 2015, 2014, 2012, 2011 by Chris Weyl. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software, licensed under: |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# The GNU Lesser General Public License, Version 2.1, February 1999 |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
package Reindeer::Types; |
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:RSRCHBOY'; |
12
|
|
|
|
|
|
|
$Reindeer::Types::VERSION = '0.019'; |
13
|
|
|
|
|
|
|
# ABSTRACT: Reindeer combined type library |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
1290
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
16
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
8
|
use base 'MooseX::Types::Combine'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
377
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
1102
|
use Reindeer::Util; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# no provision for filtering |
23
|
|
|
|
|
|
|
__PACKAGE__->provide_types_from(Reindeer::Util::type_libraries()); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
!!42; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=encoding UTF-8 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=for :stopwords Chris Weyl Alex Balhatchet |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Reindeer::Types - Reindeer combined type library |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 VERSION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
This document describes version 0.019 of Reindeer::Types - released June 09, 2017 as part of Reindeer. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SYNOPSIS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
package Foo; |
46
|
|
|
|
|
|
|
use Moose; |
47
|
|
|
|
|
|
|
use Reindeer::Types ':all'; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 DESCRIPTION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This is a combined type library, allowing for the quick and easy import of all |
52
|
|
|
|
|
|
|
the type libraries L<Reindeer> provides by default. Its primary goal is to |
53
|
|
|
|
|
|
|
make the types easily available even when using Reindeer isn't an option. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
It is not necessary (or prudent) to directly use this in a Reindeer class (or |
56
|
|
|
|
|
|
|
role). |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 TYPES |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 C<LoadableClass> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
A normal class / package. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 C<LoadableRole> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Like C<LoadableClass>, except the loaded package must be a L<Moose::Role>. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 C<SimpleStr> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
A C<Str> with no new-line characters and length <= 255. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 C<NonEmptySimpleStr> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
A C<SimpleStr> with length > 0. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 C<LowerCaseSimpleStr> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
A C<NonEmptySimpleStr> with no uppercase characters. A coercion exists via |
79
|
|
|
|
|
|
|
C<lc> from C<NonEmptySimpleStr>. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 C<UpperCaseSimpleStr> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
A C<NonEmptySimpleStr> with no lowercase characters. A coercion exists via |
84
|
|
|
|
|
|
|
C<uc> from C<NonEmptySimpleStr>. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 C<Password> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
A C<NonEmptySimpleStr> with length > 3. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 C<StrongPassword> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
A C<NonEmptySimpleStr> with length > 7 containing at least one non-alpha |
93
|
|
|
|
|
|
|
character. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 C<NonEmptyStr> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
A C<Str> with length > 0. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 C<LowerCaseStr> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
A C<Str> with length > 0 and no uppercase characters. |
102
|
|
|
|
|
|
|
A coercion exists via C<lc> from C<NonEmptyStr>. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 C<UpperCaseStr> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
A C<Str> with length > 0 and no lowercase characters. |
107
|
|
|
|
|
|
|
A coercion exists via C<uc> from C<NonEmptyStr>. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 C<NumericCode> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
A C<Str> with no new-line characters that consists of only Numeric characters. |
112
|
|
|
|
|
|
|
Examples include, Social Security Numbers, Personal Identification Numbers, Postal Codes, HTTP Status |
113
|
|
|
|
|
|
|
Codes, etc. Supports attempting to coerce from a string that has punctuation |
114
|
|
|
|
|
|
|
or whitespaces in it ( e.g credit card number 4111-1111-1111-1111 ). |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head2 C<PositiveNum> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head2 C<PositiveOrZeroNum> |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 C<PositiveInt> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head2 C<PositiveOrZeroInt> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head2 C<NegativeNum> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head2 C<NegativeOrZeroNum> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head2 C<NegativeInt> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head2 C<NegativeOrZeroInt> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 C<SingleDigit> |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head2 IxHash |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Base type: TiedHash |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
This type coerces from ArrayRef. As of 0.004 we no longer coerce from |
139
|
|
|
|
|
|
|
HashRef, as that lead to 1) annoyingly easy to miss errors involving expecting |
140
|
|
|
|
|
|
|
C<$thing->attribute( { a => 1, b => 2, ... } )> to result in proper ordering; |
141
|
|
|
|
|
|
|
and 2) the Hash native trait appearing to work normally but instead silently |
142
|
|
|
|
|
|
|
destroying the preserved order (during certain write operations). |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
(See also L<MooseX::Types::Tied::Hash::IxHash>.) |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head2 Dir |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
has 'dir' => ( |
149
|
|
|
|
|
|
|
is => 'ro', |
150
|
|
|
|
|
|
|
isa => Dir, |
151
|
|
|
|
|
|
|
required => 1, |
152
|
|
|
|
|
|
|
coerce => 1, |
153
|
|
|
|
|
|
|
); |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
(See also L<MooseX::Types::Path::Class>.) |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head2 File |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
has 'file' => ( |
160
|
|
|
|
|
|
|
is => 'ro', |
161
|
|
|
|
|
|
|
isa => File, |
162
|
|
|
|
|
|
|
required => 1, |
163
|
|
|
|
|
|
|
coerce => 1, |
164
|
|
|
|
|
|
|
); |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
(See also L<MooseX::Types::Path::Class>.) |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head2 MooseX::Types::Moose |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
We provide all Moose native types by including L<MooseX::Types::Moose>; see |
171
|
|
|
|
|
|
|
that package for more information. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head1 SEE ALSO |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Please see those modules/websites for more information related to this module. |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=over 4 |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item * |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
L<Reindeer|Reindeer> |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=item * |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
L<L<Reindeer> has the full list of type libraries we incorporate.|L<Reindeer> has the full list of type libraries we incorporate.> |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=item * |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
L<L<MooseX::Types::Combine>.|L<MooseX::Types::Combine>.> |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=back |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head1 BUGS |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website |
196
|
|
|
|
|
|
|
L<https://github.com/RsrchBoy/reindeer/issues> |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
199
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
200
|
|
|
|
|
|
|
feature. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 AUTHOR |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Chris Weyl <cweyl@alumni.drew.edu> |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
This software is Copyright (c) 2017, 2015, 2014, 2012, 2011 by Chris Weyl. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
This is free software, licensed under: |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
The GNU Lesser General Public License, Version 2.1, February 1999 |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=cut |