diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | Makefile.PL | 18 | ||||
-rw-r--r-- | README | 42 | ||||
-rw-r--r-- | lib/MooseX/AlwaysCoerce.pm | 75 | ||||
-rw-r--r-- | t/00-load.t | 9 | ||||
-rw-r--r-- | t/pod.t | 12 |
6 files changed, 157 insertions, 0 deletions
@@ -0,0 +1 @@ +Revision history for MooseX-AlwaysCoerce diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..da68f02 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,18 @@ +use inc::Module::Install; + +name 'MooseX-AlwaysCoerce'; +all_from 'lib/MooseX/AlwaysCoerce.pm'; +author 'Rafael Kitover <rkitover@cpan.org>'; +license 'perl'; + +test_requires 'Test::More'; + +requires 'Moose'; + +auto_provides; +auto_install; + +resources repository => + 'git://github.com/rkitover/mx-alwayscoerce.git'; + +WriteAll; @@ -0,0 +1,42 @@ +MooseX-AlwaysCoerce + +Moose extension to always enable coercions for attributes. + +INSTALLATION + +To install this module, run the following commands: + + perl Makefile.PL + make + make test + make install + +SUPPORT AND DOCUMENTATION + +After installing, you can find documentation for this module with the +perldoc command. + + perldoc MooseX::AlwaysCoerce + +You can also look for information at: + + RT, CPAN's request tracker + http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-AlwaysCoerce + + AnnoCPAN, Annotated CPAN documentation + http://annocpan.org/dist/MooseX-AlwaysCoerce + + CPAN Ratings + http://cpanratings.perl.org/d/MooseX-AlwaysCoerce + + Search CPAN + http://search.cpan.org/dist/MooseX-AlwaysCoerce/ + + +COPYRIGHT AND LICENCE + +Copyright (C) 2009 Rafael Kitover + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + diff --git a/lib/MooseX/AlwaysCoerce.pm b/lib/MooseX/AlwaysCoerce.pm new file mode 100644 index 0000000..6ab536e --- /dev/null +++ b/lib/MooseX/AlwaysCoerce.pm @@ -0,0 +1,75 @@ +package MooseX::AlwaysCoerce; + +use strict; +use warnings; + +=head1 NAME + +MooseX::AlwaysCoerce - Automatically enable coercions for Moose attributes + +=head1 VERSION + +Version 0.01 + +=cut + +our $VERSION = '0.01'; + +=head1 SYNOPSIS + + package MyClass; + + use Moose; + use MooseX::AlwaysCoerce; + use MyTypeLib 'SomeType'; + + has foo => (is => 'rw', isa => SomeType); # will be coerced + +=head1 AUTHOR + +Rafael Kitover, C<< <rkitover at cpan.org> >> + +=head1 BUGS + +Please report any bugs or feature requests to C<bug-moosex-alwayscoerce at rt.cpan.org>, or through +the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-AlwaysCoerce>. I will be notified, and then you'll +automatically be notified of progress on your bug as I make changes. + +=head1 SUPPORT + +You can find more information at: + +=over 4 + +=item * RT: CPAN's request tracker + +L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-AlwaysCoerce> + +=item * AnnoCPAN: Annotated CPAN documentation + +L<http://annocpan.org/dist/MooseX-AlwaysCoerce> + +=item * CPAN Ratings + +L<http://cpanratings.perl.org/d/MooseX-AlwaysCoerce> + +=item * Search CPAN + +L<http://search.cpan.org/dist/MooseX-AlwaysCoerce/> + +=back + +=head1 ACKNOWLEDGEMENTS + +My own stupidity, for inspiring me to write this module. + +=head1 COPYRIGHT & LICENSE + +Copyright (c) 2009 Rafael Kitover + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=cut + +1; # End of MooseX::AlwaysCoerce diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 0000000..61daa40 --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,9 @@ +#!perl -T + +use Test::More tests => 1; + +BEGIN { + use_ok( 'MooseX::AlwaysCoerce' ); +} + +diag( "Testing MooseX::AlwaysCoerce $MooseX::AlwaysCoerce::VERSION, Perl $], $^X" ); @@ -0,0 +1,12 @@ +#!perl -T + +use strict; +use warnings; +use Test::More; + +# Ensure a recent version of Test::Pod +my $min_tp = 1.22; +eval "use Test::Pod $min_tp"; +plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; + +all_pod_files_ok(); |