aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Etheridge <karen@etheridge.ca>2010-07-27 15:10:57 -0700
committerKaren Etheridge <karen@etheridge.ca>2010-07-27 17:49:11 -0700
commite307e391921ca301d84e6c57f569beb44d7dbb98 (patch)
tree2cd5eac0314557fde36987e8a6d8878608af976d
parent7f427a8ad30aa6e29c92c080e7474b91b2f679fd (diff)
downloadmx-alwayscoerce-e307e391921ca301d84e6c57f569beb44d7dbb98.tar.gz
mx-alwayscoerce-e307e391921ca301d84e6c57f569beb44d7dbb98.zip
update Moose::Exporter calls for post-0.93 Moose API (RT#59744)
-rw-r--r--Changes2
-rw-r--r--lib/MooseX/AlwaysCoerce.pm23
2 files changed, 14 insertions, 11 deletions
diff --git a/Changes b/Changes
index 1d2093c..7d3bf8d 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
Revision history for MooseX-AlwaysCoerce
+ - Use modern Moose APIs, to avoid warnings with Moose 1.09 (Karen Etheridge)
+
0.05 2010-07-13 00:05:10
- support types without coercion (Schwern)
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<< <rkitover at cpan.org> >>
=head1 CONTRIBUTORS
Schwern: Michael G. Schwern <mschwern@cpan.org>
+Ether: Karen Etheridge <ether@cpan.org>
=head1 BUGS