convert to Dist::Zilla
[gitmo/MooseX-Types-Common.git] / lib / MooseX / Types / Common.pm
1 package MooseX::Types::Common;
2 # ABSTRACT: A library of commonly used type constraints
3
4 use strict;
5 use warnings;
6 use Carp qw/cluck/;
7
8 sub import {
9     my $package = shift;
10     return unless @_;
11     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 __END__
18
19 =pod
20
21 =head1 SYNOPSIS
22
23     use MooseX::Types::Common::String qw/SimpleStr/;
24     has short_str => (is => 'rw', isa => SimpleStr);
25
26     ...
27     #this will fail
28     $object->short_str("string\nwith\nbreaks");
29
30
31     use MooseX::Types::Common::Numeric qw/PositiveInt/;
32     has count => (is => 'rw', isa => PositiveInt);
33
34     ...
35     #this will fail
36     $object->count(-33);
37
38 =head1 DESCRIPTION
39
40 A set of commonly-used type constraints that do not ship with Moose by default.
41
42 =head1 SEE ALSO
43
44 =over
45
46 =item * L<MooseX::Types::Common::String>
47
48 =item * L<MooseX::Types::Common::Numeric>
49
50 =item * L<MooseX::Types>
51
52 =item * L<Moose::Util::TypeConstraints>
53
54 =back
55
56 =head1 ORIGIN
57
58 This distribution was extracted from the L<Reaction> code base by Guillermo
59 Roditi (groditi).
60
61 =cut