From e307e391921ca301d84e6c57f569beb44d7dbb98 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Tue, 27 Jul 2010 15:10:57 -0700 Subject: update Moose::Exporter calls for post-0.93 Moose API (RT#59744) --- lib/MooseX/AlwaysCoerce.pm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/MooseX/AlwaysCoerce.pm b/lib/MooseX/AlwaysCoerce.pm index 3fbfd59..240dff5 100644 --- a/lib/MooseX/AlwaysCoerce.pm +++ b/lib/MooseX/AlwaysCoerce.pm @@ -81,22 +81,22 @@ Use C<< coerce => 0 >> to disable a coercion explicitly. }; } +my (undef, undef, $init_meta) = Moose::Exporter->build_import_methods( + install => [ qw(import unimport) ], + class_metaroles => { + attribute => ['MooseX::AlwaysCoerce::Role::Meta::Attribute'], + class => ['MooseX::AlwaysCoerce::Role::Meta::Class'], + }, +); + sub init_meta { - shift; - my %options = @_; + my ($class, %options) = @_; my $for_class = $options{for_class}; MooseX::ClassAttribute->import({ into => $for_class }); - Moose::Util::MetaRole::apply_metaclass_roles( - for_class => $for_class, - attribute_metaclass_roles => - ['MooseX::AlwaysCoerce::Role::Meta::Attribute'], - metaclass_roles => - ['MooseX::AlwaysCoerce::Role::Meta::Class'], - ); - - return $for_class->meta; + # call generated method to do the rest of the work. + goto $init_meta; } =head1 AUTHOR @@ -106,6 +106,7 @@ Rafael Kitover, C<< >> =head1 CONTRIBUTORS Schwern: Michael G. Schwern +Ether: Karen Etheridge =head1 BUGS -- cgit v1.2.3