Rename all MX::CA::Role::Meta packages to MX::CA::Trait, which is shorter and less...
Dave Rolsky [Tue, 9 Feb 2010 23:02:47 +0000 (17:02 -0600)]
12 files changed:
lib/MooseX/ClassAttribute.pm
lib/MooseX/ClassAttribute/Meta/Role/Attribute.pm
lib/MooseX/ClassAttribute/Trait/Application.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Application.pm with 72% similarity]
lib/MooseX/ClassAttribute/Trait/Application/ToClass.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Application/ToClass.pm with 81% similarity]
lib/MooseX/ClassAttribute/Trait/Application/ToInstance.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Application/ToInstance.pm with 87% similarity]
lib/MooseX/ClassAttribute/Trait/Application/ToRole.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Application/ToRole.pm with 68% similarity]
lib/MooseX/ClassAttribute/Trait/Attribute.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Attribute.pm with 95% similarity]
lib/MooseX/ClassAttribute/Trait/Class.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Class.pm with 94% similarity]
lib/MooseX/ClassAttribute/Trait/Mixin/HasClassAttributes.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Mixin/HasClassAttributes.pm with 96% similarity]
lib/MooseX/ClassAttribute/Trait/Role.pm [moved from lib/MooseX/ClassAttribute/Role/Meta/Role.pm with 93% similarity]
t/03-introspection.t
t/pod-coverage.t

index 219b6ff..065ec79 100644 (file)
@@ -8,11 +8,11 @@ our $AUTHORITY = 'cpan:DROLSKY';
 
 use Moose 0.89 ();
 use Moose::Exporter;
-use MooseX::ClassAttribute::Role::Meta::Class;
-use MooseX::ClassAttribute::Role::Meta::Role;
-use MooseX::ClassAttribute::Role::Meta::Application::ToClass;
-use MooseX::ClassAttribute::Role::Meta::Application::ToRole;
-use MooseX::ClassAttribute::Role::Meta::Application::ToInstance;
+use MooseX::ClassAttribute::Trait::Class;
+use MooseX::ClassAttribute::Trait::Role;
+use MooseX::ClassAttribute::Trait::Application::ToClass;
+use MooseX::ClassAttribute::Trait::Application::ToRole;
+use MooseX::ClassAttribute::Trait::Application::ToInstance;
 
 Moose::Exporter->setup_import_methods( with_meta => ['class_has'] );
 
@@ -23,16 +23,16 @@ sub init_meta {
     return Moose::Util::MetaRole::apply_metaclass_roles(
         for             => $p{for_class},
         class_metaroles => {
-            class => ['MooseX::ClassAttribute::Role::Meta::Class'],
+            class => ['MooseX::ClassAttribute::Trait::Class'],
         },
         role_metaroles => {
-            role => ['MooseX::ClassAttribute::Role::Meta::Role'],
+            role => ['MooseX::ClassAttribute::Trait::Role'],
             application_to_class =>
-                ['MooseX::ClassAttribute::Role::Meta::Application::ToClass'],
+                ['MooseX::ClassAttribute::Trait::Application::ToClass'],
             application_to_role =>
-                ['MooseX::ClassAttribute::Role::Meta::Application::ToRole'],
+                ['MooseX::ClassAttribute::Trait::Application::ToRole'],
             application_to_instance => [
-                'MooseX::ClassAttribute::Role::Meta::Application::ToInstance'
+                'MooseX::ClassAttribute::Trait::Application::ToInstance'
             ],
         },
     );
@@ -106,11 +106,11 @@ C<no MooseX::ClassAttribute> as well.
 =head2 Implementation and Immutability
 
 This module will add a role to your class's metaclass, See
-L<MooseX::ClassAttribute::Role::Meta::Class> for details. This role
+L<MooseX::ClassAttribute::Trait::Class> for details. This role
 provides introspection methods for class attributes.
 
 Class attributes themselves do the
-L<MooseX::ClassAttribute::Role::Meta::Attribute> role.
+L<MooseX::ClassAttribute::Trait::Attribute> role.
 
 There is also a L<MooseX::ClassAttribute::Meta::Method::Accessor>
 which provides part of the inlining implementation for class
index 88e2740..3141ff4 100644 (file)
@@ -15,7 +15,7 @@ sub new {
 
     $options{traits} = [
         uniq( @{ $options{traits} || [] } ),
-        'MooseX::ClassAttribute::Role::Meta::Attribute'
+        'MooseX::ClassAttribute::Trait::Attribute'
     ];
 
     return $class->SUPER::new( $name, %options );
@@ -1,4 +1,4 @@
-package MooseX::ClassAttribute::Role::Meta::Application;
+package MooseX::ClassAttribute::Trait::Application;
 
 use strict;
 use warnings;
@@ -1,4 +1,4 @@
-package MooseX::ClassAttribute::Role::Meta::Application::ToClass;
+package MooseX::ClassAttribute::Trait::Application::ToClass;
 
 use strict;
 use warnings;
@@ -6,7 +6,7 @@ use warnings;
 use namespace::autoclean;
 use Moose::Role;
 
-with 'MooseX::ClassAttribute::Role::Meta::Application';
+with 'MooseX::ClassAttribute::Trait::Application';
 
 sub apply_class_attributes {
     my $self  = shift;
@@ -16,7 +16,7 @@ sub apply_class_attributes {
     $class = Moose::Util::MetaRole::apply_metaclass_roles(
         for             => $class,
         class_metaroles => {
-            class => ['MooseX::ClassAttribute::Role::Meta::Class'],
+            class => ['MooseX::ClassAttribute::Trait::Class'],
         },
     );
 
@@ -1,4 +1,4 @@
-package MooseX::ClassAttribute::Role::Meta::Application::ToInstance;
+package MooseX::ClassAttribute::Trait::Application::ToInstance;
 
 use strict;
 use warnings;
@@ -20,7 +20,7 @@ sub apply_class_attributes {
     my $class = Moose::Util::MetaRole::apply_metaclass_roles(
         for             => ref $object,
         class_metaroles => {
-            class => ['MooseX::ClassAttribute::Role::Meta::Class'],
+            class => ['MooseX::ClassAttribute::Trait::Class'],
         },
     );
 
@@ -1,16 +1,16 @@
-package MooseX::ClassAttribute::Role::Meta::Application::ToRole;
+package MooseX::ClassAttribute::Trait::Application::ToRole;
 
 use strict;
 use warnings;
 
 use Moose::Util::MetaRole;
-use MooseX::ClassAttribute::Role::Meta::Application::ToClass;
-use MooseX::ClassAttribute::Role::Meta::Application::ToInstance;
+use MooseX::ClassAttribute::Trait::Application::ToClass;
+use MooseX::ClassAttribute::Trait::Application::ToInstance;
 
 use namespace::autoclean;
 use Moose::Role;
 
-with 'MooseX::ClassAttribute::Role::Meta::Application';
+with 'MooseX::ClassAttribute::Trait::Application';
 
 sub apply_class_attributes {
     my $self  = shift;
@@ -20,13 +20,13 @@ sub apply_class_attributes {
     $role2 = Moose::Util::MetaRole::apply_metaclass_roles(
         for            => $role2,
         role_metaroles => {
-            role => ['MooseX::ClassAttribute::Role::Meta::Role'],
+            role => ['MooseX::ClassAttribute::Trait::Role'],
             application_to_class =>
-                ['MooseX::ClassAttribute::Role::Meta::Application::ToClass'],
+                ['MooseX::ClassAttribute::Trait::Application::ToClass'],
             application_to_role =>
-                ['MooseX::ClassAttribute::Role::Meta::Application::ToRole'],
+                ['MooseX::ClassAttribute::Trait::Application::ToRole'],
             application_to_instance => [
-                'MooseX::ClassAttribute::Role::Meta::Application::ToInstance'
+                'MooseX::ClassAttribute::Trait::Application::ToInstance'
             ],
         },
     );
@@ -1,4 +1,4 @@
-package MooseX::ClassAttribute::Role::Meta::Attribute;
+package MooseX::ClassAttribute::Trait::Attribute;
 
 use strict;
 use warnings;
@@ -133,7 +133,7 @@ __END__
 
 =head1 NAME
 
-MooseX::ClassAttribute::Role::Meta::Attribute - An attribute role for classes with class attributes
+MooseX::ClassAttribute::Trait::Attribute - An attribute role for classes with class attributes
 
 =head1 DESCRIPTION
 
similarity index 94%
rename from lib/MooseX/ClassAttribute/Role/Meta/Class.pm
rename to lib/MooseX/ClassAttribute/Trait/Class.pm
index 8ec293b..3bb887c 100644 (file)
@@ -1,15 +1,15 @@
-package MooseX::ClassAttribute::Role::Meta::Class;
+package MooseX::ClassAttribute::Trait::Class;
 
 use strict;
 use warnings;
 
-use MooseX::ClassAttribute::Role::Meta::Attribute;
+use MooseX::ClassAttribute::Trait::Attribute;
 use Scalar::Util qw( blessed );
 
 use namespace::autoclean;
 use Moose::Role;
 
-with 'MooseX::ClassAttribute::Role::Meta::Mixin::HasClassAttributes';
+with 'MooseX::ClassAttribute::Trait::Mixin::HasClassAttributes';
 
 has _class_attribute_values => (
     traits  => ['Hash'],
@@ -87,10 +87,10 @@ sub _process_new_class_attribute {
     my %p    = @_;
 
     if ( $p{traits} ) {
-        push @{ $p{traits} }, 'MooseX::ClassAttribute::Role::Meta::Attribute';
+        push @{ $p{traits} }, 'MooseX::ClassAttribute::Trait::Attribute';
     }
     else {
-        $p{traits} = ['MooseX::ClassAttribute::Role::Meta::Attribute'];
+        $p{traits} = ['MooseX::ClassAttribute::Trait::Attribute'];
     }
 
     return Moose::Meta::Attribute->interpolate_class_and_new( $name, %p );
@@ -231,7 +231,7 @@ __END__
 
 =head1 NAME
 
-MooseX::ClassAttribute::Role::Meta::Class - A metaclass role for classes with class attributes
+MooseX::ClassAttribute::Trait::Class - A metaclass role for classes with class attributes
 
 =head1 SYNOPSIS
 
@@ -1,4 +1,4 @@
-package MooseX::ClassAttribute::Role::Meta::Mixin::HasClassAttributes;
+package MooseX::ClassAttribute::Trait::Mixin::HasClassAttributes;
 
 use strict;
 use warnings;
similarity index 93%
rename from lib/MooseX/ClassAttribute/Role/Meta/Role.pm
rename to lib/MooseX/ClassAttribute/Trait/Role.pm
index 3530dc6..6f86e25 100644 (file)
@@ -1,4 +1,4 @@
-package MooseX::ClassAttribute::Role::Meta::Role;
+package MooseX::ClassAttribute::Trait::Role;
 
 use strict;
 use warnings;
@@ -9,7 +9,7 @@ use Scalar::Util qw( blessed );
 use namespace::autoclean;
 use Moose::Role;
 
-with 'MooseX::ClassAttribute::Role::Meta::Mixin::HasClassAttributes';
+with 'MooseX::ClassAttribute::Trait::Mixin::HasClassAttributes';
 
 around add_class_attribute => sub {
     my $orig = shift;
@@ -39,7 +39,7 @@ __END__
 
 =head1 NAME
 
-MooseX::ClassAttribute::Role::Meta::Class - A metaclass role for classes with class attributes
+MooseX::ClassAttribute::Trait::Class - A metaclass role for classes with class attributes
 
 =head1 SYNOPSIS
 
index 3ea04b0..dee90d1 100644 (file)
@@ -15,8 +15,8 @@ ok(
 
 ok(
     HasClassAttribute->meta()->get_class_attribute('ObjectCount')->meta()
-        ->does_role('MooseX::ClassAttribute::Role::Meta::Attribute'),
-    'get_class_attribute_list returns an object which does the MooseX::ClassAttribute::Role::Meta::Attribute role'
+        ->does_role('MooseX::ClassAttribute::Trait::Attribute'),
+    'get_class_attribute_list returns an object which does the MooseX::ClassAttribute::Trait::Attribute role'
 );
 
 my @ca = qw( Delegatee
index 5c57228..03241db 100644 (file)
@@ -17,7 +17,7 @@ plan tests => scalar @modules;
 
 my %trustme =
     ( 'MooseX::ClassAttribute'                         => [ 'init_meta', 'class_has' ],
-      'MooseX::ClassAttribute::Role::Meta::Class'      => [ 'compute_all_applicable_class_attributes' ],
+      'MooseX::ClassAttribute::Trait::Class'      => [ 'compute_all_applicable_class_attributes' ],
       'MooseX::ClassAttribute::Meta::Method::Accessor' => [ '.+' ]
     );