From: Jesse Luehrs Date: Fri, 10 Jul 2009 01:50:23 +0000 (-0500) Subject: do all the renaming that was discussed X-Git-Tag: 0.89_02~92 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a40b446a169aa45a5f2b868eb1ddfcec22515fe3;p=gitmo%2FMoose.git do all the renaming that was discussed in particular, Moose::AttributeHelpers::Trait::* becomes Moose::Meta::Attribute::Trait::Native::*, and Collection:: is dropped from trait names (and short names) --- diff --git a/lib/Moose/AttributeHelpers.pm b/lib/Moose/AttributeHelpers.pm index 177bdaa..19b2ff3 100644 --- a/lib/Moose/AttributeHelpers.pm +++ b/lib/Moose/AttributeHelpers.pm @@ -7,14 +7,14 @@ our $AUTHORITY = 'cpan:STEVAN'; use Moose; -use Moose::AttributeHelpers::Trait::Bool; -use Moose::AttributeHelpers::Trait::Counter; -use Moose::AttributeHelpers::Trait::Number; -use Moose::AttributeHelpers::Trait::String; -use Moose::AttributeHelpers::Trait::Collection::List; -use Moose::AttributeHelpers::Trait::Collection::Array; -use Moose::AttributeHelpers::Trait::Collection::Hash; -use Moose::AttributeHelpers::Trait::Collection::ImmutableHash; +use Moose::Meta::Attribute::Trait::Native::Bool; +use Moose::Meta::Attribute::Trait::Native::Counter; +use Moose::Meta::Attribute::Trait::Native::Number; +use Moose::Meta::Attribute::Trait::Native::String; +use Moose::Meta::Attribute::Trait::Native::List; +use Moose::Meta::Attribute::Trait::Native::Array; +use Moose::Meta::Attribute::Trait::Native::Hash; +use Moose::Meta::Attribute::Trait::Native::ImmutableHash; 1; @@ -33,7 +33,7 @@ Moose::AttributeHelpers - Extend your attribute interfaces use Moose::AttributeHelpers; has 'mapping' => ( - traits => [ 'Collection::Hash' ], + traits => [ 'Hash' ], is => 'rw', isa => 'HashRef[Str]', default => sub { {} }, @@ -89,35 +89,35 @@ works normally for C<< handles >>. =over -=item L +=item L Common numerical operations. -=item L +=item L Common methods for string operations. -=item L +=item L Methods for incrementing and decrementing a counter attribute. -=item L +=item L Common methods for boolean values. -=item L +=item L Common methods for hash references. -=item L +=item L Common methods for inspecting hash references. -=item L +=item L Common methods for array references. -=item L +=item L Common list methods for array references. diff --git a/lib/Moose/Manual/Attributes.pod b/lib/Moose/Manual/Attributes.pod index 174c624..7c714d7 100644 --- a/lib/Moose/Manual/Attributes.pod +++ b/lib/Moose/Manual/Attributes.pod @@ -513,16 +513,16 @@ of ways through the use of custom metaclasses and metaclass traits. When declaring an attribute, you can declare a metaclass or a set of traits for the attribute: - use MooseX::AttributeHelpers; + use Moose::AttributeHelpers; has 'mapping' => ( - metaclass => 'Collection::Hash', + metaclass => 'Hash', is => 'ro', default => sub { {} }, ); -In this case, the metaclass C really refers to -L. +In this case, the metaclass C really refers to +L. You can also apply one or more traits to an attribute: diff --git a/lib/Moose/AttributeHelpers/Trait/Collection/Array.pm b/lib/Moose/Meta/Attribute/Trait/Native/Array.pm similarity index 72% rename from lib/Moose/AttributeHelpers/Trait/Collection/Array.pm rename to lib/Moose/Meta/Attribute/Trait/Native/Array.pm index 1279f63..61e66ee 100644 --- a/lib/Moose/AttributeHelpers/Trait/Collection/Array.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/Array.pm @@ -1,20 +1,20 @@ -package Moose::AttributeHelpers::Trait::Collection::Array; +package Moose::Meta::Attribute::Trait::Native::Array; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::AttributeHelpers::MethodProvider::Array; +use Moose::Meta::Attribute::Trait::Native::MethodProvider::Array; -with 'Moose::AttributeHelpers::Trait::Collection'; +with 'Moose::Meta::Attribute::Trait::Native::Collection'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::AttributeHelpers::MethodProvider::Array' + default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Array' ); sub _helper_type { 'ArrayRef' } @@ -22,9 +22,9 @@ sub _helper_type { 'ArrayRef' } no Moose::Role; package # hide me from search.cpan.org - Moose::Meta::Attribute::Custom::Trait::Collection::Array; + Moose::Meta::Attribute::Custom::Trait::Array; sub register_implementation { - 'Moose::AttributeHelpers::Trait::Collection::Array' + 'Moose::Meta::Attribute::Trait::Native::Array' } @@ -36,7 +36,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::Collection::Array +Moose::Meta::Attribute::Trait::Native::Array =head1 SYNOPSIS @@ -45,7 +45,7 @@ Moose::AttributeHelpers::Collection::Array use Moose::AttributeHelpers; has 'options' => ( - metaclass => 'Collection::Array', + metaclass => 'Array', is => 'ro', isa => 'ArrayRef[Int]', default => sub { [] }, @@ -58,7 +58,7 @@ Moose::AttributeHelpers::Collection::Array =head1 DESCRIPTION This module provides an Array attribute which provides a number of -array operations. See L +array operations. See L for more details. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/Trait/Base.pm b/lib/Moose/Meta/Attribute/Trait/Native/Base.pm similarity index 96% rename from lib/Moose/AttributeHelpers/Trait/Base.pm rename to lib/Moose/Meta/Attribute/Trait/Native/Base.pm index 59c1bd5..6829ee9 100644 --- a/lib/Moose/AttributeHelpers/Trait/Base.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/Base.pm @@ -1,5 +1,5 @@ -package Moose::AttributeHelpers::Trait::Base; +package Moose::Meta::Attribute::Trait::Native::Base; use Moose::Role; use Moose::Util::TypeConstraints; @@ -140,7 +140,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::Trait::Base - base role for helpers +Moose::Meta::Attribute::Trait::Native::Base - base role for helpers =head1 BUGS diff --git a/lib/Moose/AttributeHelpers/Trait/Bool.pm b/lib/Moose/Meta/Attribute/Trait/Native/Bool.pm similarity index 85% rename from lib/Moose/AttributeHelpers/Trait/Bool.pm rename to lib/Moose/Meta/Attribute/Trait/Native/Bool.pm index 2743028..d5c0e3c 100644 --- a/lib/Moose/AttributeHelpers/Trait/Bool.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/Bool.pm @@ -1,12 +1,12 @@ -package Moose::AttributeHelpers::Trait::Bool; +package Moose::Meta::Attribute::Trait::Native::Bool; use Moose::Role; -use Moose::AttributeHelpers::MethodProvider::Bool; +use Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -with 'Moose::AttributeHelpers::Trait::Base'; +with 'Moose::Meta::Attribute::Trait::Native::Base'; sub _default_is { 'rw' } sub _helper_type { 'Bool' } @@ -18,14 +18,14 @@ has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::AttributeHelpers::MethodProvider::Bool' + default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool' ); no Moose::Role; package # hide me from search.cpan.org Moose::Meta::Attribute::Custom::Trait::Bool; -sub register_implementation { 'Moose::AttributeHelpers::Trait::Bool' } +sub register_implementation { 'Moose::Meta::Attribute::Trait::Native::Bool' } 1; @@ -33,7 +33,7 @@ sub register_implementation { 'Moose::AttributeHelpers::Trait::Bool' } =head1 NAME -Moose::AttributeHelpers::Bool +Moose::Meta::Attribute::Trait::Native::Bool =head1 SYNOPSIS diff --git a/lib/Moose/AttributeHelpers/Trait/Collection.pm b/lib/Moose/Meta/Attribute/Trait/Native/Collection.pm similarity index 80% rename from lib/Moose/AttributeHelpers/Trait/Collection.pm rename to lib/Moose/Meta/Attribute/Trait/Native/Collection.pm index f456371..ffbbaee 100644 --- a/lib/Moose/AttributeHelpers/Trait/Collection.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/Collection.pm @@ -1,12 +1,12 @@ -package Moose::AttributeHelpers::Trait::Collection; +package Moose::Meta::Attribute::Trait::Native::Collection; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -with 'Moose::AttributeHelpers::Trait::Base'; +with 'Moose::Meta::Attribute::Trait::Native::Base'; no Moose::Role; @@ -18,7 +18,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::Collection - Base class for all collection type helpers +Moose::Meta::Attribute::Trait::Native::Collection - Base class for all collection type helpers =head1 DESCRIPTION diff --git a/lib/Moose/AttributeHelpers/Trait/Counter.pm b/lib/Moose/Meta/Attribute/Trait/Native/Counter.pm similarity index 88% rename from lib/Moose/AttributeHelpers/Trait/Counter.pm rename to lib/Moose/Meta/Attribute/Trait/Native/Counter.pm index e1d21ef..6fbb68d 100644 --- a/lib/Moose/AttributeHelpers/Trait/Counter.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/Counter.pm @@ -1,20 +1,20 @@ -package Moose::AttributeHelpers::Trait::Counter; +package Moose::Meta::Attribute::Trait::Native::Counter; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::AttributeHelpers::MethodProvider::Counter; +use Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter; -with 'Moose::AttributeHelpers::Trait::Base'; +with 'Moose::Meta::Attribute::Trait::Native::Base'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::AttributeHelpers::MethodProvider::Counter', + default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter', ); sub _default_default { 0 } @@ -41,7 +41,7 @@ no Moose::Role; package # hide me from search.cpan.org Moose::Meta::Attribute::Custom::Trait::Counter; -sub register_implementation { 'Moose::AttributeHelpers::Trait::Counter' } +sub register_implementation { 'Moose::Meta::Attribute::Trait::Native::Counter' } 1; @@ -51,7 +51,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::Counter +Moose::Meta::Attribute::Trait::Native::Counter =head1 SYNOPSIS diff --git a/lib/Moose/AttributeHelpers/Trait/Collection/Hash.pm b/lib/Moose/Meta/Attribute/Trait/Native/Hash.pm similarity index 73% rename from lib/Moose/AttributeHelpers/Trait/Collection/Hash.pm rename to lib/Moose/Meta/Attribute/Trait/Native/Hash.pm index 08aaaeb..0c79951 100644 --- a/lib/Moose/AttributeHelpers/Trait/Collection/Hash.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/Hash.pm @@ -1,20 +1,20 @@ -package Moose::AttributeHelpers::Trait::Collection::Hash; +package Moose::Meta::Attribute::Trait::Native::Hash; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::AttributeHelpers::MethodProvider::Hash; +use Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash; -with 'Moose::AttributeHelpers::Trait::Collection'; +with 'Moose::Meta::Attribute::Trait::Native::Collection'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::AttributeHelpers::MethodProvider::Hash' + default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash' ); sub _helper_type { 'HashRef' } @@ -22,9 +22,9 @@ sub _helper_type { 'HashRef' } no Moose::Role; package # hide me from search.cpan.org - Moose::Meta::Attribute::Custom::Trait::Collection::Hash; + Moose::Meta::Attribute::Custom::Trait::Hash; sub register_implementation { - 'Moose::AttributeHelpers::Trait::Collection::Hash' + 'Moose::Meta::Attribute::Trait::Native::Hash' } @@ -36,7 +36,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::Collection::Hash +Moose::Meta::Attribute::Trait::Native::Hash =head1 SYNOPSIS @@ -45,7 +45,7 @@ Moose::AttributeHelpers::Collection::Hash use Moose::AttributeHelpers; has 'options' => ( - metaclass => 'Collection::Hash', + metaclass => 'Hash', is => 'ro', isa => 'HashRef[Str]', default => sub { {} }, @@ -61,7 +61,7 @@ Moose::AttributeHelpers::Collection::Hash =head1 DESCRIPTION This module provides a Hash attribute which provides a number of -hash-like operations. See L +hash-like operations. See L for more details. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/Trait/Collection/ImmutableHash.pm b/lib/Moose/Meta/Attribute/Trait/Native/ImmutableHash.pm similarity index 70% rename from lib/Moose/AttributeHelpers/Trait/Collection/ImmutableHash.pm rename to lib/Moose/Meta/Attribute/Trait/Native/ImmutableHash.pm index 96c0e28..9f35512 100644 --- a/lib/Moose/AttributeHelpers/Trait/Collection/ImmutableHash.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/ImmutableHash.pm @@ -1,20 +1,20 @@ -package Moose::AttributeHelpers::Trait::Collection::ImmutableHash; +package Moose::Meta::Attribute::Trait::Native::ImmutableHash; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::AttributeHelpers::MethodProvider::ImmutableHash; +use Moose::Meta::Attribute::Trait::Native::MethodProvider::ImmutableHash; -with 'Moose::AttributeHelpers::Trait::Collection'; +with 'Moose::Meta::Attribute::Trait::Native::Collection'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::AttributeHelpers::MethodProvider::ImmutableHash' + default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::ImmutableHash' ); sub _helper_type { 'HashRef' } @@ -22,9 +22,9 @@ sub _helper_type { 'HashRef' } no Moose::Role; package # hide me from search.cpan.org - Moose::Meta::Attribute::Custom::Trait::Collection::ImmutableHash; + Moose::Meta::Attribute::Custom::Trait::ImmutableHash; sub register_implementation { - 'Moose::AttributeHelpers::Trait::Collection::ImmutableHash' + 'Moose::Meta::Attribute::Trait::Native::ImmutableHash' } @@ -36,7 +36,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::Collection::ImmutableHash +Moose::Meta::Attribute::Trait::Native::ImmutableHash =head1 SYNOPSIS @@ -45,7 +45,7 @@ Moose::AttributeHelpers::Collection::ImmutableHash use Moose::AttributeHelpers; has 'options' => ( - metaclass => 'Collection::ImmutableHash', + metaclass => 'ImmutableHash', is => 'ro', isa => 'HashRef[Str]', default => sub { {} }, @@ -59,7 +59,7 @@ Moose::AttributeHelpers::Collection::ImmutableHash =head1 DESCRIPTION This module provides a immutable HashRef attribute which provides a number of -hash-line operations. See L +hash-line operations. See L for more details. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/Trait/Collection/List.pm b/lib/Moose/Meta/Attribute/Trait/Native/List.pm similarity index 72% rename from lib/Moose/AttributeHelpers/Trait/Collection/List.pm rename to lib/Moose/Meta/Attribute/Trait/Native/List.pm index f9b0b43..180bff0 100644 --- a/lib/Moose/AttributeHelpers/Trait/Collection/List.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/List.pm @@ -1,20 +1,20 @@ -package Moose::AttributeHelpers::Trait::Collection::List; +package Moose::Meta::Attribute::Trait::Native::List; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::AttributeHelpers::MethodProvider::List; +use Moose::Meta::Attribute::Trait::Native::MethodProvider::List; -with 'Moose::AttributeHelpers::Trait::Collection'; +with 'Moose::Meta::Attribute::Trait::Native::Collection'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::AttributeHelpers::MethodProvider::List' + default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::List' ); sub _helper_type { 'ArrayRef' } @@ -22,9 +22,9 @@ sub _helper_type { 'ArrayRef' } no Moose::Role; package # hide me from search.cpan.org - Moose::Meta::Attribute::Custom::Trait::Collection::List; + Moose::Meta::Attribute::Custom::Trait::List; sub register_implementation { - 'Moose::AttributeHelpers::Trait::Collection::List' + 'Moose::Meta::Attribute::Trait::Native::List' } @@ -36,7 +36,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::Collection::List +Moose::Meta::Attribute::Trait::Native::List =head1 SYNOPSIS @@ -45,7 +45,7 @@ Moose::AttributeHelpers::Collection::List use Moose::AttributeHelpers; has 'options' => ( - metaclass => 'Collection::List', + metaclass => 'List', is => 'ro', isa => 'ArrayRef[Int]', default => sub { [] }, @@ -58,7 +58,7 @@ Moose::AttributeHelpers::Collection::List =head1 DESCRIPTION This module provides an List attribute which provides a number of -list operations. See L +list operations. See L for more details. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/MethodProvider/Array.pm b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Array.pm similarity index 97% rename from lib/Moose/AttributeHelpers/MethodProvider/Array.pm rename to lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Array.pm index f2d00ca..d302645 100644 --- a/lib/Moose/AttributeHelpers/MethodProvider/Array.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Array.pm @@ -1,11 +1,11 @@ -package Moose::AttributeHelpers::MethodProvider::Array; +package Moose::Meta::Attribute::Trait::Native::MethodProvider::Array; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -with 'Moose::AttributeHelpers::MethodProvider::List'; +with 'Moose::Meta::Attribute::Trait::Native::MethodProvider::List'; sub push : method { my ( $attr, $reader, $writer ) = @_; @@ -246,12 +246,12 @@ __END__ =head1 NAME -Moose::AttributeHelpers::MethodProvider::Array +Moose::Meta::Attribute::Trait::Native::MethodProvider::Array =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/MethodProvider/Bool.pm b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Bool.pm similarity index 87% rename from lib/Moose/AttributeHelpers/MethodProvider/Bool.pm rename to lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Bool.pm index 52aa999..63ed055 100644 --- a/lib/Moose/AttributeHelpers/MethodProvider/Bool.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Bool.pm @@ -1,5 +1,5 @@ -package Moose::AttributeHelpers::MethodProvider::Bool; +package Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool; use Moose::Role; our $VERSION = '0.87'; @@ -34,12 +34,12 @@ __END__ =head1 NAME -Moose::AttributeHelpers::MethodProvider::Bool +Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/MethodProvider/Counter.pm b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Counter.pm similarity index 88% rename from lib/Moose/AttributeHelpers/MethodProvider/Counter.pm rename to lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Counter.pm index 0a82303..595d291 100644 --- a/lib/Moose/AttributeHelpers/MethodProvider/Counter.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Counter.pm @@ -1,5 +1,5 @@ -package Moose::AttributeHelpers::MethodProvider::Counter; +package Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter; use Moose::Role; our $VERSION = '0.87'; @@ -40,12 +40,12 @@ __END__ =head1 NAME -Moose::AttributeHelpers::MethodProvider::Counter +Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/MethodProvider/Hash.pm b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Hash.pm similarity index 93% rename from lib/Moose/AttributeHelpers/MethodProvider/Hash.pm rename to lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Hash.pm index 9109810..8cf1f6c 100644 --- a/lib/Moose/AttributeHelpers/MethodProvider/Hash.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Hash.pm @@ -1,11 +1,11 @@ -package Moose::AttributeHelpers::MethodProvider::Hash; +package Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -with 'Moose::AttributeHelpers::MethodProvider::ImmutableHash'; +with 'Moose::Meta::Attribute::Trait::Native::MethodProvider::ImmutableHash'; sub set : method { my ( $attr, $reader, $writer ) = @_; @@ -125,15 +125,15 @@ __END__ =head1 NAME -Moose::AttributeHelpers::MethodProvider::Hash +Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. This role is composed from the -L role. +L role. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/MethodProvider/ImmutableHash.pm b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/ImmutableHash.pm similarity index 93% rename from lib/Moose/AttributeHelpers/MethodProvider/ImmutableHash.pm rename to lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/ImmutableHash.pm index 21e0eda..1ea1fef 100644 --- a/lib/Moose/AttributeHelpers/MethodProvider/ImmutableHash.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/ImmutableHash.pm @@ -1,4 +1,4 @@ -package Moose::AttributeHelpers::MethodProvider::ImmutableHash; +package Moose::Meta::Attribute::Trait::Native::MethodProvider::ImmutableHash; use Moose::Role; our $VERSION = '0.87'; @@ -72,12 +72,12 @@ __END__ =head1 NAME -Moose::AttributeHelpers::MethodProvider::ImmutableHash +Moose::Meta::Attribute::Trait::Native::MethodProvider::ImmutableHash =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/MethodProvider/List.pm b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/List.pm similarity index 96% rename from lib/Moose/AttributeHelpers/MethodProvider/List.pm rename to lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/List.pm index 32c1122..3c340b5 100644 --- a/lib/Moose/AttributeHelpers/MethodProvider/List.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/List.pm @@ -1,4 +1,4 @@ -package Moose::AttributeHelpers::MethodProvider::List; +package Moose::Meta::Attribute::Trait::Native::MethodProvider::List; use Moose::Role; our $VERSION = '0.87'; @@ -107,7 +107,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::MethodProvider::List +Moose::Meta::Attribute::Trait::Native::MethodProvider::List =head1 SYNOPSIS @@ -116,7 +116,7 @@ Moose::AttributeHelpers::MethodProvider::List use Moose::AttributeHelpers; has 'options' => ( - metaclass => 'Collection::List', + metaclass => 'List', is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] }, @@ -142,7 +142,7 @@ Moose::AttributeHelpers::MethodProvider::List =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/MethodProvider/String.pm b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/String.pm similarity index 94% rename from lib/Moose/AttributeHelpers/MethodProvider/String.pm rename to lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/String.pm index 9385bfc..9be3ee1 100644 --- a/lib/Moose/AttributeHelpers/MethodProvider/String.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/String.pm @@ -1,5 +1,5 @@ -package Moose::AttributeHelpers::MethodProvider::String; +package Moose::Meta::Attribute::Trait::Native::MethodProvider::String; use Moose::Role; our $VERSION = '0.87'; @@ -104,12 +104,12 @@ __END__ =head1 NAME -Moose::AttributeHelpers::MethodProvider::String +Moose::Meta::Attribute::Trait::Native::MethodProvider::String =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. =head1 METHODS diff --git a/lib/Moose/AttributeHelpers/Trait/Number.pm b/lib/Moose/Meta/Attribute/Trait/Native/Number.pm similarity index 93% rename from lib/Moose/AttributeHelpers/Trait/Number.pm rename to lib/Moose/Meta/Attribute/Trait/Native/Number.pm index b9a837c..62e3ad7 100644 --- a/lib/Moose/AttributeHelpers/Trait/Number.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/Number.pm @@ -1,11 +1,11 @@ -package Moose::AttributeHelpers::Trait::Number; +package Moose::Meta::Attribute::Trait::Native::Number; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -with 'Moose::AttributeHelpers::Trait::Base'; +with 'Moose::Meta::Attribute::Trait::Native::Base'; sub _helper_type { 'Num' } @@ -54,7 +54,7 @@ no Moose::Role; package # hide me from search.cpan.org Moose::Meta::Attribute::Custom::Trait::Number; -sub register_implementation { 'Moose::AttributeHelpers::Trait::Number' } +sub register_implementation { 'Moose::Meta::Attribute::Trait::Native::Number' } 1; @@ -62,7 +62,7 @@ sub register_implementation { 'Moose::AttributeHelpers::Trait::Number' } =head1 NAME -Moose::AttributeHelpers::Number +Moose::Meta::Attribute::Trait::Native::Number =head1 SYNOPSIS diff --git a/lib/Moose/AttributeHelpers/Trait/String.pm b/lib/Moose/Meta/Attribute/Trait/Native/String.pm similarity index 89% rename from lib/Moose/AttributeHelpers/Trait/String.pm rename to lib/Moose/Meta/Attribute/Trait/Native/String.pm index 22c69c5..8db22cf 100644 --- a/lib/Moose/AttributeHelpers/Trait/String.pm +++ b/lib/Moose/Meta/Attribute/Trait/Native/String.pm @@ -1,20 +1,20 @@ -package Moose::AttributeHelpers::Trait::String; +package Moose::Meta::Attribute::Trait::Native::String; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::AttributeHelpers::MethodProvider::String; +use Moose::Meta::Attribute::Trait::Native::MethodProvider::String; -with 'Moose::AttributeHelpers::Trait::Base'; +with 'Moose::Meta::Attribute::Trait::Native::Base'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::AttributeHelpers::MethodProvider::String', + default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::String', ); sub _default_default { q{} } @@ -39,7 +39,7 @@ no Moose::Role; package # hide me from search.cpan.org Moose::Meta::Attribute::Custom::Trait::String; -sub register_implementation { 'Moose::AttributeHelpers::Trait::String' } +sub register_implementation { 'Moose::Meta::Attribute::Trait::Native::String' } 1; @@ -49,7 +49,7 @@ __END__ =head1 NAME -Moose::AttributeHelpers::String +Moose::Meta::Attribute::Trait::Native::String =head1 SYNOPSIS diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 82ce504..3b00c3e 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -645,7 +645,7 @@ sub create { ##################################################################### # # has 'roles' => ( -# metaclass => 'Collection::Array', +# metaclass => 'Array', # reader => 'get_roles', # isa => 'ArrayRef[Moose::Meta::Role]', # default => sub { [] }, @@ -655,7 +655,7 @@ sub create { # ); # # has 'excluded_roles_map' => ( -# metaclass => 'Collection::Hash', +# metaclass => 'Hash', # reader => 'get_excluded_roles_map', # isa => 'HashRef[Str]', # provides => { @@ -667,7 +667,7 @@ sub create { # ); # # has 'attribute_map' => ( -# metaclass => 'Collection::Hash', +# metaclass => 'Hash', # reader => 'get_attribute_map', # isa => 'HashRef[Str]', # provides => { @@ -681,7 +681,7 @@ sub create { # ); # # has 'required_methods' => ( -# metaclass => 'Collection::Hash', +# metaclass => 'Hash', # reader => 'get_required_methods_map', # isa => 'HashRef[Moose::Meta::Role::Method::Required]', # provides => { @@ -698,7 +698,7 @@ sub create { # # CODE refs to apply in that order # # has 'before_method_modifiers' => ( -# metaclass => 'Collection::Hash', +# metaclass => 'Hash', # reader => 'get_before_method_modifiers_map', # isa => 'HashRef[ArrayRef[CodeRef]]', # provides => { @@ -712,7 +712,7 @@ sub create { # ); # # has 'after_method_modifiers' => ( -# metaclass => 'Collection::Hash', +# metaclass => 'Hash', # reader =>'get_after_method_modifiers_map', # isa => 'HashRef[ArrayRef[CodeRef]]', # provides => { @@ -726,7 +726,7 @@ sub create { # ); # # has 'around_method_modifiers' => ( -# metaclass => 'Collection::Hash', +# metaclass => 'Hash', # reader =>'get_around_method_modifiers_map', # isa => 'HashRef[ArrayRef[CodeRef]]', # provides => { @@ -744,7 +744,7 @@ sub create { # # but instead just a single name->code mapping # # has 'override_method_modifiers' => ( -# metaclass => 'Collection::Hash', +# metaclass => 'Hash', # reader =>'get_override_method_modifiers_map', # isa => 'HashRef[CodeRef]', # provides => { diff --git a/t/070_attribute_helpers/010_array_from_role.t b/t/070_attribute_helpers/010_array_from_role.t index b647a98..0b1967b 100644 --- a/t/070_attribute_helpers/010_array_from_role.t +++ b/t/070_attribute_helpers/010_array_from_role.t @@ -17,7 +17,7 @@ use Test::Exception; use Moose::AttributeHelpers; has 'options' => ( - traits => ['Collection::Array'], + traits => ['Array'], is => 'ro', isa => 'ArrayRef[Foo]', ); @@ -27,7 +27,7 @@ use Test::Exception; use Moose::AttributeHelpers; has 'stuff' => ( - traits => ['Collection::Array'], + traits => ['Array'], is => 'ro', isa => 'ArrayRef', handles => { diff --git a/t/070_attribute_helpers/011_counter_with_defaults.t b/t/070_attribute_helpers/011_counter_with_defaults.t index e2299b2..363da28 100644 --- a/t/070_attribute_helpers/011_counter_with_defaults.t +++ b/t/070_attribute_helpers/011_counter_with_defaults.t @@ -40,7 +40,7 @@ is( $page->counter, 0, '... got the original value' ); # check the meta .. my $counter = $page->meta->get_attribute('counter'); -does_ok( $counter, 'Moose::AttributeHelpers::Trait::Counter' ); +does_ok( $counter, 'Moose::Meta::Attribute::Trait::Native::Counter' ); is( $counter->type_constraint->name, 'Num', '... got the expected default type constraint' ); diff --git a/t/070_attribute_helpers/100_collection_with_roles.t b/t/070_attribute_helpers/100_collection_with_roles.t index 806d0c0..f03cffe 100644 --- a/t/070_attribute_helpers/100_collection_with_roles.t +++ b/t/070_attribute_helpers/100_collection_with_roles.t @@ -12,7 +12,7 @@ use Test::More tests => 28; use Moose::AttributeHelpers; has observers => ( - traits => ['Collection::Array'], + traits => ['Array'], is => 'ro', isa => 'ArrayRef[Observer]', auto_deref => 1, diff --git a/t/070_attribute_helpers/201_trait_counter.t b/t/070_attribute_helpers/201_trait_counter.t index cdb0642..e1e1ee9 100644 --- a/t/070_attribute_helpers/201_trait_counter.t +++ b/t/070_attribute_helpers/201_trait_counter.t @@ -61,7 +61,7 @@ is( $page->counter, 2, '... decrement by arg' ); # check the meta .. my $counter = $page->meta->get_attribute('counter'); -does_ok( $counter, 'Moose::AttributeHelpers::Trait::Counter' ); +does_ok( $counter, 'Moose::Meta::Attribute::Trait::Native::Counter' ); is( $counter->type_constraint->name, 'Int', '... got the expected type constraint' ); diff --git a/t/070_attribute_helpers/202_trait_array.t b/t/070_attribute_helpers/202_trait_array.t index cab89d0..cd96943 100644 --- a/t/070_attribute_helpers/202_trait_array.t +++ b/t/070_attribute_helpers/202_trait_array.t @@ -16,7 +16,7 @@ my $sort; use Moose::AttributeHelpers; has 'options' => ( - traits => ['Collection::Array'], + traits => ['Array'], is => 'ro', isa => 'ArrayRef[Str]', default => sub { [] }, @@ -244,7 +244,7 @@ dies_ok { ## test the meta my $options = $stuff->meta->get_attribute('options'); -does_ok( $options, 'Moose::AttributeHelpers::Trait::Collection::Array' ); +does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Array' ); is_deeply( $options->handles, diff --git a/t/070_attribute_helpers/203_trait_hash.t b/t/070_attribute_helpers/203_trait_hash.t index b809571..9418f67 100644 --- a/t/070_attribute_helpers/203_trait_hash.t +++ b/t/070_attribute_helpers/203_trait_hash.t @@ -13,7 +13,7 @@ use Test::Moose 'does_ok'; use Moose::AttributeHelpers; has 'options' => ( - traits => ['Collection::Hash'], + traits => ['Hash'], is => 'ro', isa => 'HashRef[Str]', default => sub { {} }, @@ -142,7 +142,7 @@ dies_ok { ## test the meta my $options = $stuff->meta->get_attribute('options'); -does_ok( $options, 'Moose::AttributeHelpers::Trait::Collection::Hash' ); +does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Hash' ); is_deeply( $options->handles, diff --git a/t/070_attribute_helpers/204_trait_number.t b/t/070_attribute_helpers/204_trait_number.t index 9b2c700..297614d 100644 --- a/t/070_attribute_helpers/204_trait_number.t +++ b/t/070_attribute_helpers/204_trait_number.t @@ -91,7 +91,7 @@ is $real->integer, 12, 'dec 13'; ## test the meta my $attr = $real->meta->get_attribute('integer'); -does_ok( $attr, 'Moose::AttributeHelpers::Trait::Number' ); +does_ok( $attr, 'Moose::Meta::Attribute::Trait::Native::Number' ); is_deeply( $attr->handles, diff --git a/t/070_attribute_helpers/205_trait_list.t b/t/070_attribute_helpers/205_trait_list.t index 1c342e6..d3ca58e 100644 --- a/t/070_attribute_helpers/205_trait_list.t +++ b/t/070_attribute_helpers/205_trait_list.t @@ -16,7 +16,7 @@ my $up; use Moose::AttributeHelpers; has '_options' => ( - traits => ['Collection::List'], + traits => ['List'], is => 'ro', isa => 'ArrayRef[Int]', init_arg => 'options', @@ -112,7 +112,7 @@ is_deeply( [ $stuff->descending ], [ reverse 1 .. 10 ] ); ## test the meta my $options = $stuff->meta->get_attribute('_options'); -does_ok( $options, 'Moose::AttributeHelpers::Trait::Collection::List' ); +does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::List' ); is_deeply( $options->handles, diff --git a/t/070_attribute_helpers/207_trait_string.t b/t/070_attribute_helpers/207_trait_string.t index a6af0ad..4363025 100644 --- a/t/070_attribute_helpers/207_trait_string.t +++ b/t/070_attribute_helpers/207_trait_string.t @@ -86,7 +86,7 @@ is( $page->string, '', "clear" ); # check the meta .. my $string = $page->meta->get_attribute('string'); -does_ok( $string, 'Moose::AttributeHelpers::Trait::String' ); +does_ok( $string, 'Moose::Meta::Attribute::Trait::Native::String' ); is( $string->type_constraint->name, 'Str',