line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Reindeer |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is Copyright (c) 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.018'; |
13
|
|
|
|
|
|
|
# ABSTRACT: Reindeer combined type library |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
1128
|
use strict; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
28
|
|
16
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
4
|
use base 'MooseX::Types::Combine'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
396
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
887
|
use Reindeer::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
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 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=for :stopwords Wishlist flattr flattr'ed gittip gittip'ed |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Reindeer::Types - Reindeer combined type library |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 VERSION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This document describes version 0.018 of Reindeer::Types - released March 28, 2015 as part of Reindeer. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 SYNOPSIS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
package Foo; |
48
|
|
|
|
|
|
|
use Moose; |
49
|
|
|
|
|
|
|
use Reindeer::Types ':all'; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 DESCRIPTION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
This is a combined type library, allowing for the quick and easy import of all |
54
|
|
|
|
|
|
|
the type libraries L<Reindeer> provides by default. Its primary goal is to |
55
|
|
|
|
|
|
|
make the types easily available even when using Reindeer isn't an option. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
It is not necessary (or prudent) to directly use this in a Reindeer class (or |
58
|
|
|
|
|
|
|
role). |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 TYPES |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 C<LoadableClass> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
A normal class / package. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 C<LoadableRole> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Like C<LoadableClass>, except the loaded package must be a L<Moose::Role>. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 C<SimpleStr> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
A C<Str> with no new-line characters. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 C<NonEmptySimpleStr> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
A C<Str> with no new-line characters and length > 0 |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 C<LowerCaseSimpleStr> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
A C<Str> with no new-line characters, length > 0 and no uppercase characters |
81
|
|
|
|
|
|
|
A coercion exists via C<lc> from C<NonEmptySimpleStr> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 C<UpperCaseSimpleStr> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
A C<Str> with no new-line characters, length > 0 and no lowercase characters |
86
|
|
|
|
|
|
|
A coercion exists via C<uc> from C<NonEmptySimpleStr> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 C<Password> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 C<StrongPassword> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 C<NonEmptyStr> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
A C<Str> with length > 0 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 C<LowerCaseStr> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
A C<Str> with length > 0 and no uppercase characters. |
99
|
|
|
|
|
|
|
A coercion exists via C<lc> from C<NonEmptyStr> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 C<UpperCaseStr> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
A C<Str> with length > 0 and no lowercase characters. |
104
|
|
|
|
|
|
|
A coercion exists via C<uc> from C<NonEmptyStr> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 C<NumericCode> |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
A C<Str> with no new-line characters that consists of only Numeric characters. |
109
|
|
|
|
|
|
|
Examples include, Social Security Numbers, Personal Identification Numbers, Postal Codes, HTTP Status |
110
|
|
|
|
|
|
|
Codes, etc. Supports attempting to coerce from a string that has punctuation |
111
|
|
|
|
|
|
|
in it ( e.g credit card number 4111-1111-1111-1111 ). |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 C<PositiveNum> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head2 C<PositiveOrZeroNum> |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head2 C<PositiveInt> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 C<PositiveOrZeroInt> |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head2 C<NegativeNum> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 C<NegativeOrZeroNum> |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 C<NegativeInt> |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head2 C<NegativeOrZeroInt> |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 C<SingleDigit> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 IxHash |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Base type: TiedHash |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This type coerces from ArrayRef. As of 0.004 we no longer coerce from |
136
|
|
|
|
|
|
|
HashRef, as that lead to 1) annoyingly easy to miss errors involving expecting |
137
|
|
|
|
|
|
|
C<$thing->attribute( { a => 1, b => 2, ... } )> to result in proper ordering; |
138
|
|
|
|
|
|
|
and 2) the Hash native trait appearing to work normally but instead silently |
139
|
|
|
|
|
|
|
destroying the preserved order (during certain write operations). |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
(See also L<MooseX::Types::Tied::Hash::IxHash>.) |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head2 Dir |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
has 'dir' => ( |
146
|
|
|
|
|
|
|
is => 'ro', |
147
|
|
|
|
|
|
|
isa => Dir, |
148
|
|
|
|
|
|
|
required => 1, |
149
|
|
|
|
|
|
|
coerce => 1, |
150
|
|
|
|
|
|
|
); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
(See also L<MooseX::Types::Path::Class>.) |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head2 File |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
has 'file' => ( |
157
|
|
|
|
|
|
|
is => 'ro', |
158
|
|
|
|
|
|
|
isa => File, |
159
|
|
|
|
|
|
|
required => 1, |
160
|
|
|
|
|
|
|
coerce => 1, |
161
|
|
|
|
|
|
|
); |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
(See also L<MooseX::Types::Path::Class>.) |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head2 MooseX::Types::Moose |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
We provide all Moose native types by including L<MooseX::Types::Moose>; see |
168
|
|
|
|
|
|
|
that package for more information. |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head1 SEE ALSO |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Please see those modules/websites for more information related to this module. |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=over 4 |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=item * |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
L<Reindeer|Reindeer> |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item * |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
L<L<Reindeer> has the full list of type libraries we incorporate.|L<Reindeer> has the full list of type libraries we incorporate.> |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item * |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
L<L<MooseX::Types::Combine>.|L<MooseX::Types::Combine>.> |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=back |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head1 SOURCE |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
The development version is on github at L<http://https://github.com/RsrchBoy/reindeer> |
193
|
|
|
|
|
|
|
and may be cloned from L<git://https://github.com/RsrchBoy/reindeer.git> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head1 BUGS |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website |
198
|
|
|
|
|
|
|
https://github.com/RsrchBoy/reindeer/issues |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
201
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
202
|
|
|
|
|
|
|
feature. |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=head1 AUTHOR |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
Chris Weyl <cweyl@alumni.drew.edu> |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=head2 I'm a material boy in a material world |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=begin html |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
<a href="https://www.gittip.com/RsrchBoy/"><img src="https://raw.githubusercontent.com/gittip/www.gittip.com/master/www/assets/%25version/logo.png" /></a> |
213
|
|
|
|
|
|
|
<a href="http://bit.ly/rsrchboys-wishlist"><img src="http://wps.io/wp-content/uploads/2014/05/amazon_wishlist.resized.png" /></a> |
214
|
|
|
|
|
|
|
<a href="https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Freindeer&title=RsrchBoy's%20CPAN%20Reindeer&tags=%22RsrchBoy's%20Reindeer%20in%20the%20CPAN%22"><img src="http://api.flattr.com/button/flattr-badge-large.png" /></a> |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=end html |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Please note B<I do not expect to be gittip'ed or flattr'ed for this work>, |
219
|
|
|
|
|
|
|
rather B<it is simply a very pleasant surprise>. I largely create and release |
220
|
|
|
|
|
|
|
works like this because I need them or I find it enjoyable; however, don't let |
221
|
|
|
|
|
|
|
that stop you if you feel like it ;) |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
L<Flattr this|https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Freindeer&title=RsrchBoy's%20CPAN%20Reindeer&tags=%22RsrchBoy's%20Reindeer%20in%20the%20CPAN%22>, |
224
|
|
|
|
|
|
|
L<gittip me|https://www.gittip.com/RsrchBoy/>, or indulge my |
225
|
|
|
|
|
|
|
L<Amazon Wishlist|http://bit.ly/rsrchboys-wishlist>... If you so desire. |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
This software is Copyright (c) 2011 by Chris Weyl. |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
This is free software, licensed under: |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
The GNU Lesser General Public License, Version 2.1, February 1999 |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |