| 1 | package Mason::PluginRole; | ||
| 2 | $Mason::PluginRole::VERSION = '2.23'; | ||
| 3 | use Moose::Role (); | ||
| 4 | use Method::Signatures::Simple (); | ||
| 5 | use Moose::Exporter; | ||
| 6 | Moose::Exporter->setup_import_methods( also => ['Moose::Role'] ); | ||
| 7 | |||
| 8 | sub init_meta { | ||
| 9 | my $class = shift; | ||
| 10 | my %params = @_; | ||
| 11 | my $for_class = $params{for_class}; | ||
| 12 | Method::Signatures::Simple->import( into => $for_class ); | ||
| 13 | Moose::Role->init_meta(@_); | ||
| 14 | } | ||
| 15 | |||
| 16 | 1; | ||
| 17 | |||
| 18 | __END__ | ||
| 19 | |||
| 20 | =pod | ||
| 21 | |||
| 22 | =head1 NAME | ||
| 23 | |||
| 24 | Mason::PluginRole - Helper for defining Mason plugin roles | ||
| 25 | |||
| 26 | =head1 SYNOPSIS | ||
| 27 | |||
| 28 | # instead of use Moose::Role; | ||
| 29 | use Mason::PluginRole; | ||
| 30 | |||
| 31 | =head1 DESCRIPTION | ||
| 32 | |||
| 33 | A variant on Moose::Role that can be used in Mason plugin roles. Using this | ||
| 34 | module is equivalent to | ||
| 35 | |||
| 36 | use Moose::Role; | ||
| 37 | use Method::Signatures::Simple; | ||
| 38 | |||
| 39 | =head1 SEE ALSO | ||
| 40 | |||
| 41 | L<Mason|Mason> | ||
| 42 | |||
| 43 | =head1 AUTHOR | ||
| 44 | |||
| 45 | Jonathan Swartz <swartz@pobox.com> | ||
| 46 | |||
| 47 | =head1 COPYRIGHT AND LICENSE | ||
| 48 | |||
| 49 | This software is copyright (c) 2012 by Jonathan Swartz. | ||
| 50 | |||
| 51 | This is free software; you can redistribute it and/or modify it under | ||
| 52 | the same terms as the Perl 5 programming language system itself. | ||
| 53 | |||
| 54 | =cut |