bump version to 0.66
[gitmo/Moose.git] / lib / Moose / Util / MetaRole.pm
index 2beb525..f3e8bf3 100644 (file)
@@ -3,6 +3,10 @@ package Moose::Util::MetaRole;
 use strict;
 use warnings;
 
+our $VERSION   = '0.66';
+$VERSION = eval $VERSION;
+our $AUTHORITY = 'cpan:STEVAN';
+
 use List::MoreUtils qw( all );
 
 my @Classes = qw( constructor_class destructor_class error_class );
@@ -12,11 +16,12 @@ sub apply_metaclass_roles {
 
     my $for = $options{for_class};
 
-    my %old_classes = map { $_ => $for->meta->$_ } @Classes;
+    my %old_classes
+        = map { $_ => $for->meta->$_ } grep { $for->meta->can($_) } @Classes;
 
     my $meta = _make_new_metaclass( $for, \%options );
 
-    for my $c (@Classes) {
+    for my $c ( grep { $meta->can($_) } @Classes ) {
         if ( $options{ $c . '_roles' } ) {
             my $class = _make_new_class(
                 $meta->$c(),
@@ -154,7 +159,7 @@ experimental, and it could go away in the future!>
 This utility module is designed to help authors of Moose extensions
 write extensions that are able to cooperate with other Moose
 extensions. To do this, you must write your extensions as roles, which
-can then be dynamically applyied to the caller's metaclasses.
+can then be dynamically applied to the caller's metaclasses.
 
 This module makes sure to preserve any existing superclasses and roles
 already set for the meta objects, which means that any number of
@@ -254,7 +259,7 @@ Dave Rolsky E<lt>autarch@urth.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2008 by Infinity Interactive, Inc.
+Copyright 2009 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>