40a785166b1bd07d155c10e3919ba38693d3846b
[gitmo/MooseX-Types-Common.git] / lib / MooseX / Types / Common.pm
1 package MooseX::Types::Common;
2
3 use strict;
4 use warnings;
5 use Carp qw/cluck/;
6
7 our $VERSION = '0.001008';
8
9 sub import {
10     my $package = shift;
11     return unless @_;
12     cluck("Tried to import the symbols " . join(', ', @_)
13         . " from MooseX::Types::Common.\nDid you mean "
14         . "MooseX::Types::Common::String or MooseX::Type::Common::Numeric?");
15 }
16
17 1;
18
19 =head1 NAME
20
21 MooseX::Types::Common - A library of commonly used type constraints
22
23 =head1 SYNOPSIS
24
25     use MooseX::Types::Common::String qw/SimpleStr/;
26     has short_str => (is => 'rw', isa => SimpleStr);
27
28     ...
29     #this will fail
30     $object->short_str("string\nwith\nbreaks");
31
32
33
34     use MooseX::Types::Common::Numeric qw/PositiveInt/;
35     has count => (is => 'rw', isa => PositiveInt);
36
37     ...
38     #this will fail
39     $object->count(-33);
40
41 =head1 DESCRIPTION
42
43 A set of commonly-used type constraints that do not ship with Moose by default.
44
45 =head1 SEE ALSO
46
47 =over
48
49 =item * L<MooseX::Types::Common::String>
50
51 =item * L<MooseX::Types::Common::Numeric>
52
53 =item * L<MooseX::Types>
54
55 =item * L<Moose::Util::TypeConstraints>
56
57 =back
58
59 =head1 AUTHORS
60
61 This distribution was extracted from the L<Reaction> code base by Guillermo
62 Roditi (groditi).
63
64 The original authors of this library are:
65
66 =over 4
67
68 =item * Matt S. Trout
69
70 =item * K. J. Cheetham
71
72 =item * Guillermo Roditi
73
74 =back
75
76 =head1 LICENSE
77
78 This library is free software, you can redistribute it and/or modify
79 it under the same terms as Perl itself.
80
81 =cut