bump version
[gitmo/Moose.git] / lib / Moose / Util / MetaRole.pm
index 65ce42c..0c79b3d 100644 (file)
@@ -4,14 +4,21 @@ use strict;
 use warnings;
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.93_02';
+our $VERSION   = '1.23';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
 use List::MoreUtils qw( all );
 use List::Util qw( first );
+use Moose::Deprecated;
 
 sub apply_metaclass_roles {
+    Moose::Deprecated::deprecated(
+        feature => 'pre-0.94 MetaRole API',
+        message =>
+            'The old Moose::Util::MetaRole API (before version 0.94) has been deprecated'
+    );
+
     goto &apply_metaroles;
 }
 
@@ -19,7 +26,7 @@ sub apply_metaroles {
     my %args = @_;
 
     _fixup_old_style_args(\%args);
-    Carp::cluck('applying') if $::D;
+
     my $for
         = blessed $args{for}
         ? $args{for}
@@ -36,7 +43,13 @@ sub apply_metaroles {
 sub _fixup_old_style_args {
     my $args = shift;
 
-    return if $args->{class_metaroles} || $args->{roles_metaroles};
+    return if $args->{class_metaroles} || $args->{role_metaroles};
+
+    Moose::Deprecated::deprecated(
+        feature => 'pre-0.94 MetaRole API',
+        message =>
+            'The old Moose::Util::MetaRole API (before version 0.94) has been deprecated'
+    );
 
     $args->{for} = delete $args->{for_class}
         if exists $args->{for_class};
@@ -211,16 +224,9 @@ extensions can apply roles in any order.
 
 =head1 USAGE
 
-B<It is very important that you only call this module's functions when
-your module is imported by the caller>. The process of applying roles
-to the metaclass reinitializes the metaclass object, which wipes out
-any existing attributes already defined. However, as long as you do
-this when your module is imported, the caller should not have any
-attributes defined yet.
-
-The easiest way to ensure that this happens is to use
-L<Moose::Exporter>, which can generate the appropriate C<init_meta>
-method for you, and make sure it is called when imported.
+The easiest way to use this module is through L<Moose::Exporter>, which can
+generate the appropriate C<init_meta> method for you, and make sure it is
+called when imported.
 
 =head1 FUNCTIONS
 
@@ -228,8 +234,11 @@ This module provides two functions.
 
 =head2 apply_metaroles( ... )
 
-This function will apply roles to one or more metaclasses for the
-specified class. It accepts the following parameters:
+This function will apply roles to one or more metaclasses for the specified
+class. It will return a new metaclass object for the class or role passed in
+the "for" parameter.
+
+It accepts the following parameters:
 
 =over 4
 
@@ -313,7 +322,7 @@ Dave Rolsky E<lt>autarch@urth.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2009 by Infinity Interactive, Inc.
+Copyright 2009-2010 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>