From: Hans Dieter Pearcey Date: Mon, 3 Aug 2009 02:50:02 +0000 (-0700) Subject: mass renaming, including removing MethodProviders from the Trait namespace X-Git-Tag: 0.89_02~80 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c466e58f62cf93887b29809993bd7830c8350079;p=gitmo%2FMoose.git mass renaming, including removing MethodProviders from the Trait namespace --- diff --git a/lib/Moose/Attribute/Native.pm b/lib/Moose/Attribute/Native.pm index 731b18a..dbbc38b 100644 --- a/lib/Moose/Attribute/Native.pm +++ b/lib/Moose/Attribute/Native.pm @@ -8,7 +8,7 @@ our $AUTHORITY = 'cpan:STEVAN'; my @trait_names = qw(Bool Counter Number String Array Hash); for my $trait_name (@trait_names) { - my $trait_class = "Moose::Meta::Attribute::Trait::Native::$trait_name"; + my $trait_class = "Moose::Meta::Attribute::Native::Trait::$trait_name"; my $meta = Class::MOP::Class->initialize( "Moose::Meta::Attribute::Custom::Trait::$trait_name" ); @@ -99,35 +99,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/Meta/Attribute/Trait/Native/MethodProvider/Array.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm similarity index 99% rename from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Array.pm rename to lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm index 5e5ac72..d387e78 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Array.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm @@ -1,4 +1,4 @@ -package Moose::Meta::Attribute::Trait::Native::MethodProvider::Array; +package Moose::Meta::Attribute::Native::MethodProvider::Array; use Moose::Role; our $VERSION = '0.87'; @@ -331,7 +331,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::MethodProvider::Array +Moose::Meta::Attribute::Native::MethodProvider::Array =head1 SYNOPSIS diff --git a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Bool.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Bool.pm similarity index 90% rename from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Bool.pm rename to lib/Moose/Meta/Attribute/Native/MethodProvider/Bool.pm index 63ed055..f9b1825 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Bool.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Bool.pm @@ -1,5 +1,5 @@ -package Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool; +package Moose::Meta::Attribute::Native::MethodProvider::Bool; use Moose::Role; our $VERSION = '0.87'; @@ -34,7 +34,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool +Moose::Meta::Attribute::Native::MethodProvider::Bool =head1 DESCRIPTION diff --git a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Counter.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm similarity index 91% rename from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Counter.pm rename to lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm index 595d291..52f43d3 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Counter.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm @@ -1,5 +1,5 @@ -package Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter; +package Moose::Meta::Attribute::Native::MethodProvider::Counter; use Moose::Role; our $VERSION = '0.87'; @@ -40,7 +40,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter +Moose::Meta::Attribute::Native::MethodProvider::Counter =head1 DESCRIPTION diff --git a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Hash.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm similarity index 98% rename from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Hash.pm rename to lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm index 173de8b..d8282d8 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm @@ -1,4 +1,4 @@ -package Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash; +package Moose::Meta::Attribute::Native::MethodProvider::Hash; use Moose::Role; our $VERSION = '0.87'; @@ -183,7 +183,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash +Moose::Meta::Attribute::Native::MethodProvider::Hash =head1 DESCRIPTION diff --git a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/String.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/String.pm similarity index 95% rename from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/String.pm rename to lib/Moose/Meta/Attribute/Native/MethodProvider/String.pm index b90b060..c8e2372 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/String.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/String.pm @@ -1,5 +1,5 @@ -package Moose::Meta::Attribute::Trait::Native::MethodProvider::String; +package Moose::Meta::Attribute::Native::MethodProvider::String; use Moose::Role; our $VERSION = '0.87'; @@ -112,7 +112,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::MethodProvider::String +Moose::Meta::Attribute::Native::MethodProvider::String =head1 DESCRIPTION diff --git a/lib/Moose/Meta/Attribute/Trait/Native.pm b/lib/Moose/Meta/Attribute/Native/Trait.pm similarity index 97% rename from lib/Moose/Meta/Attribute/Trait/Native.pm rename to lib/Moose/Meta/Attribute/Native/Trait.pm index a8ab4a5..35d578b 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait.pm @@ -1,5 +1,5 @@ -package Moose::Meta::Attribute::Trait::Native; +package Moose::Meta::Attribute::Native::Trait; use Moose::Role; use Moose::Util::TypeConstraints; @@ -140,7 +140,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native - base role for helpers +Moose::Meta::Attribute::Native::Trait - base role for helpers =head1 BUGS diff --git a/lib/Moose/Meta/Attribute/Trait/Native/Array.pm b/lib/Moose/Meta/Attribute/Native/Trait/Array.pm similarity index 77% rename from lib/Moose/Meta/Attribute/Trait/Native/Array.pm rename to lib/Moose/Meta/Attribute/Native/Trait/Array.pm index 1fcbe7c..5693035 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/Array.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Array.pm @@ -1,20 +1,20 @@ -package Moose::Meta::Attribute::Trait::Native::Array; +package Moose::Meta::Attribute::Native::Trait::Array; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::Meta::Attribute::Trait::Native::MethodProvider::Array; +use Moose::Meta::Attribute::Native::MethodProvider::Array; -with 'Moose::Meta::Attribute::Trait::Native'; +with 'Moose::Meta::Attribute::Native::Trait'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Array' + default => 'Moose::Meta::Attribute::Native::MethodProvider::Array' ); sub _helper_type { 'ArrayRef' } @@ -29,7 +29,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::Array +Moose::Meta::Attribute::Native::Trait::Array =head1 SYNOPSIS @@ -51,7 +51,7 @@ Moose::Meta::Attribute::Trait::Native::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/Meta/Attribute/Trait/Native/Bool.pm b/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm similarity index 87% rename from lib/Moose/Meta/Attribute/Trait/Native/Bool.pm rename to lib/Moose/Meta/Attribute/Native/Trait/Bool.pm index aba8f58..20cf24c 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/Bool.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm @@ -1,12 +1,12 @@ -package Moose::Meta::Attribute::Trait::Native::Bool; +package Moose::Meta::Attribute::Native::Trait::Bool; use Moose::Role; -use Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool; +use Moose::Meta::Attribute::Native::MethodProvider::Bool; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -with 'Moose::Meta::Attribute::Trait::Native'; +with 'Moose::Meta::Attribute::Native::Trait'; sub _default_is { 'rw' } sub _helper_type { 'Bool' } @@ -18,7 +18,7 @@ has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool' + default => 'Moose::Meta::Attribute::Native::MethodProvider::Bool' ); no Moose::Role; @@ -29,7 +29,7 @@ no Moose::Role; =head1 NAME -Moose::Meta::Attribute::Trait::Native::Bool +Moose::Meta::Attribute::Native::Trait::Bool =head1 SYNOPSIS diff --git a/lib/Moose/Meta/Attribute/Trait/Native/Counter.pm b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm similarity index 90% rename from lib/Moose/Meta/Attribute/Trait/Native/Counter.pm rename to lib/Moose/Meta/Attribute/Native/Trait/Counter.pm index 87681a0..2a86a62 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/Counter.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm @@ -1,20 +1,20 @@ -package Moose::Meta::Attribute::Trait::Native::Counter; +package Moose::Meta::Attribute::Native::Trait::Counter; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter; +use Moose::Meta::Attribute::Native::MethodProvider::Counter; -with 'Moose::Meta::Attribute::Trait::Native'; +with 'Moose::Meta::Attribute::Native::Trait'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter', + default => 'Moose::Meta::Attribute::Native::MethodProvider::Counter', ); sub _default_default { 0 } @@ -47,7 +47,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::Counter +Moose::Meta::Attribute::Native::Trait::Counter =head1 SYNOPSIS diff --git a/lib/Moose/Meta/Attribute/Trait/Native/Hash.pm b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm similarity index 78% rename from lib/Moose/Meta/Attribute/Trait/Native/Hash.pm rename to lib/Moose/Meta/Attribute/Native/Trait/Hash.pm index a7a9ffa..b2c6bd2 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm @@ -1,20 +1,20 @@ -package Moose::Meta::Attribute::Trait::Native::Hash; +package Moose::Meta::Attribute::Native::Trait::Hash; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash; +use Moose::Meta::Attribute::Native::MethodProvider::Hash; -with 'Moose::Meta::Attribute::Trait::Native'; +with 'Moose::Meta::Attribute::Native::Trait'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash' + default => 'Moose::Meta::Attribute::Native::MethodProvider::Hash' ); sub _helper_type { 'HashRef' } @@ -29,7 +29,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::Hash +Moose::Meta::Attribute::Native::Trait::Hash =head1 SYNOPSIS @@ -54,7 +54,7 @@ Moose::Meta::Attribute::Trait::Native::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/Meta/Attribute/Trait/Native/Number.pm b/lib/Moose/Meta/Attribute/Native/Trait/Number.pm similarity index 95% rename from lib/Moose/Meta/Attribute/Trait/Native/Number.pm rename to lib/Moose/Meta/Attribute/Native/Trait/Number.pm index 1114dce..0d3cb25 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/Number.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Number.pm @@ -1,11 +1,11 @@ -package Moose::Meta::Attribute::Trait::Native::Number; +package Moose::Meta::Attribute::Native::Trait::Number; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -with 'Moose::Meta::Attribute::Trait::Native'; +with 'Moose::Meta::Attribute::Native::Trait'; sub _helper_type { 'Num' } @@ -58,7 +58,7 @@ no Moose::Role; =head1 NAME -Moose::Meta::Attribute::Trait::Native::Number +Moose::Meta::Attribute::Native::Trait::Number =head1 SYNOPSIS diff --git a/lib/Moose/Meta/Attribute/Trait/Native/String.pm b/lib/Moose/Meta/Attribute/Native/Trait/String.pm similarity index 91% rename from lib/Moose/Meta/Attribute/Trait/Native/String.pm rename to lib/Moose/Meta/Attribute/Native/Trait/String.pm index 1bde822..47f1f8c 100644 --- a/lib/Moose/Meta/Attribute/Trait/Native/String.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/String.pm @@ -1,20 +1,20 @@ -package Moose::Meta::Attribute::Trait::Native::String; +package Moose::Meta::Attribute::Native::Trait::String; use Moose::Role; our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use Moose::Meta::Attribute::Trait::Native::MethodProvider::String; +use Moose::Meta::Attribute::Native::MethodProvider::String; -with 'Moose::Meta::Attribute::Trait::Native'; +with 'Moose::Meta::Attribute::Native::Trait'; has 'method_provider' => ( is => 'ro', isa => 'ClassName', predicate => 'has_method_provider', - default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::String', + default => 'Moose::Meta::Attribute::Native::MethodProvider::String', ); sub _default_default { q{} } @@ -45,7 +45,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Trait::Native::String +Moose::Meta::Attribute::Native::Trait::String =head1 SYNOPSIS diff --git a/t/070_attribute_traits/000_load.t b/t/070_native_traits/000_load.t similarity index 100% rename from t/070_attribute_traits/000_load.t rename to t/070_native_traits/000_load.t diff --git a/t/070_attribute_traits/010_array_from_role.t b/t/070_native_traits/010_array_from_role.t similarity index 100% rename from t/070_attribute_traits/010_array_from_role.t rename to t/070_native_traits/010_array_from_role.t diff --git a/t/070_attribute_traits/011_counter_with_defaults.t b/t/070_native_traits/011_counter_with_defaults.t similarity index 94% rename from t/070_attribute_traits/011_counter_with_defaults.t rename to t/070_native_traits/011_counter_with_defaults.t index cc197c7..77a5c71 100644 --- a/t/070_attribute_traits/011_counter_with_defaults.t +++ b/t/070_native_traits/011_counter_with_defaults.t @@ -39,7 +39,7 @@ is( $page->counter, 0, '... got the original value' ); # check the meta .. my $counter = $page->meta->get_attribute('counter'); -does_ok( $counter, 'Moose::Meta::Attribute::Trait::Native::Counter' ); +does_ok( $counter, 'Moose::Meta::Attribute::Native::Trait::Counter' ); is( $counter->type_constraint->name, 'Num', '... got the expected default type constraint' ); diff --git a/t/070_attribute_traits/020_remove_attribute.t b/t/070_native_traits/020_remove_attribute.t similarity index 100% rename from t/070_attribute_traits/020_remove_attribute.t rename to t/070_native_traits/020_remove_attribute.t diff --git a/t/070_attribute_traits/100_collection_with_roles.t b/t/070_native_traits/100_collection_with_roles.t similarity index 100% rename from t/070_attribute_traits/100_collection_with_roles.t rename to t/070_native_traits/100_collection_with_roles.t diff --git a/t/070_attribute_traits/201_trait_counter.t b/t/070_native_traits/201_trait_counter.t similarity index 96% rename from t/070_attribute_traits/201_trait_counter.t rename to t/070_native_traits/201_trait_counter.t index b18c941..432ab29 100644 --- a/t/070_attribute_traits/201_trait_counter.t +++ b/t/070_native_traits/201_trait_counter.t @@ -60,7 +60,7 @@ is( $page->counter, 2, '... decrement by arg' ); # check the meta .. my $counter = $page->meta->get_attribute('counter'); -does_ok( $counter, 'Moose::Meta::Attribute::Trait::Native::Counter' ); +does_ok( $counter, 'Moose::Meta::Attribute::Native::Trait::Counter' ); is( $counter->type_constraint->name, 'Int', '... got the expected type constraint' ); diff --git a/t/070_attribute_traits/202_trait_array.t b/t/070_native_traits/202_trait_array.t similarity index 99% rename from t/070_attribute_traits/202_trait_array.t rename to t/070_native_traits/202_trait_array.t index c4309aa..3d41983 100644 --- a/t/070_attribute_traits/202_trait_array.t +++ b/t/070_native_traits/202_trait_array.t @@ -243,7 +243,7 @@ dies_ok { ## test the meta my $options = $stuff->meta->get_attribute('options'); -does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Array' ); +does_ok( $options, 'Moose::Meta::Attribute::Native::Trait::Array' ); is_deeply( $options->handles, diff --git a/t/070_attribute_traits/203_trait_hash.t b/t/070_native_traits/203_trait_hash.t similarity index 98% rename from t/070_attribute_traits/203_trait_hash.t rename to t/070_native_traits/203_trait_hash.t index ed4066f..392a27d 100644 --- a/t/070_attribute_traits/203_trait_hash.t +++ b/t/070_native_traits/203_trait_hash.t @@ -141,7 +141,7 @@ dies_ok { ## test the meta my $options = $stuff->meta->get_attribute('options'); -does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Hash' ); +does_ok( $options, 'Moose::Meta::Attribute::Native::Trait::Hash' ); is_deeply( $options->handles, diff --git a/t/070_attribute_traits/204_trait_number.t b/t/070_native_traits/204_trait_number.t similarity index 96% rename from t/070_attribute_traits/204_trait_number.t rename to t/070_native_traits/204_trait_number.t index a54e5aa..c3566cc 100644 --- a/t/070_attribute_traits/204_trait_number.t +++ b/t/070_native_traits/204_trait_number.t @@ -90,7 +90,7 @@ is $real->integer, 12, 'dec 13'; ## test the meta my $attr = $real->meta->get_attribute('integer'); -does_ok( $attr, 'Moose::Meta::Attribute::Trait::Native::Number' ); +does_ok( $attr, 'Moose::Meta::Attribute::Native::Trait::Number' ); is_deeply( $attr->handles, diff --git a/t/070_attribute_traits/205_trait_list.t b/t/070_native_traits/205_trait_list.t similarity index 98% rename from t/070_attribute_traits/205_trait_list.t rename to t/070_native_traits/205_trait_list.t index bc53153..e2a0359 100644 --- a/t/070_attribute_traits/205_trait_list.t +++ b/t/070_native_traits/205_trait_list.t @@ -111,7 +111,7 @@ is_deeply( [ $stuff->descending ], [ reverse 1 .. 10 ] ); ## test the meta my $options = $stuff->meta->get_attribute('_options'); -does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Array' ); +does_ok( $options, 'Moose::Meta::Attribute::Native::Trait::Array' ); is_deeply( $options->handles, diff --git a/t/070_attribute_traits/207_trait_string.t b/t/070_native_traits/207_trait_string.t similarity index 97% rename from t/070_attribute_traits/207_trait_string.t rename to t/070_native_traits/207_trait_string.t index d51abfd..c14ff01 100644 --- a/t/070_attribute_traits/207_trait_string.t +++ b/t/070_native_traits/207_trait_string.t @@ -89,7 +89,7 @@ is( $page->string, '', "clear" ); # check the meta .. my $string = $page->meta->get_attribute('string'); -does_ok( $string, 'Moose::Meta::Attribute::Trait::Native::String' ); +does_ok( $string, 'Moose::Meta::Attribute::Native::Trait::String' ); is( $string->type_constraint->name, 'Str', diff --git a/t/070_attribute_traits/208_trait_bool.t b/t/070_native_traits/208_trait_bool.t similarity index 100% rename from t/070_attribute_traits/208_trait_bool.t rename to t/070_native_traits/208_trait_bool.t