bump version
[gitmo/MooseX-Types-Common.git] / lib / MooseX / Types / Common.pm
CommitLineData
3379cc45 1package MooseX::Types::Common;
2
3use strict;
4use warnings;
acf4d245 5use Carp qw/cluck/;
3379cc45 6
31633b26 7our $VERSION = '0.001005';
3379cc45 8
acf4d245 9sub 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
3379cc45 171;
18
19=head1 NAME
20
6820e939 21MooseX::Types::Common - A library of commonly used type constraints
3379cc45 22
23=head1 SYNOPSIS
24
ac73ab52 25 use MooseX::Types::Common::String qw/SimpleStr/;
3379cc45 26 has short_str => (is => 'rw', isa => SimpleStr);
27
28 ...
29 #this will fail
30 $object->short_str("string\nwith\nbreaks");
31
3379cc45 32
3379cc45 33
ac73ab52 34 use MooseX::Types::Common::Numeric qw/PositiveInt/;
35 has count => (is => 'rw', isa => PositiveInt);
3379cc45 36
ac73ab52 37 ...
38 #this will fail
39 $object->count(-33);
3379cc45 40
ac73ab52 41=head1 DESCRIPTION
3379cc45 42
ac73ab52 43A set of commonly-used type constraints that do not ship with Moose by default.
3379cc45 44
45=head1 SEE ALSO
46
47=over
48
ac73ab52 49=item * L<MooseX::Types::Common::String>
50
51=item * L<MooseX::Types::Common::Numeric>
52
3379cc45 53=item * L<MooseX::Types>
54
55=item * L<Moose::Util::TypeConstraints>
56
57=back
58
59=head1 AUTHORS
60
61This distribution was extracted from the L<Reaction> code base by Guillermo
62Roditi (groditi).
63
64The 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
78This library is free software, you can redistribute it and/or modify
79it under the same terms as Perl itself.
80
81=cut