mass renaming, including removing MethodProviders from the Trait namespace
Hans Dieter Pearcey [Mon, 3 Aug 2009 02:50:02 +0000 (19:50 -0700)]
25 files changed:
lib/Moose/Attribute/Native.pm
lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Array.pm with 99% similarity]
lib/Moose/Meta/Attribute/Native/MethodProvider/Bool.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Bool.pm with 90% similarity]
lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Counter.pm with 91% similarity]
lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/Hash.pm with 98% similarity]
lib/Moose/Meta/Attribute/Native/MethodProvider/String.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/MethodProvider/String.pm with 95% similarity]
lib/Moose/Meta/Attribute/Native/Trait.pm [moved from lib/Moose/Meta/Attribute/Trait/Native.pm with 97% similarity]
lib/Moose/Meta/Attribute/Native/Trait/Array.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/Array.pm with 77% similarity]
lib/Moose/Meta/Attribute/Native/Trait/Bool.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/Bool.pm with 87% similarity]
lib/Moose/Meta/Attribute/Native/Trait/Counter.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/Counter.pm with 90% similarity]
lib/Moose/Meta/Attribute/Native/Trait/Hash.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/Hash.pm with 78% similarity]
lib/Moose/Meta/Attribute/Native/Trait/Number.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/Number.pm with 95% similarity]
lib/Moose/Meta/Attribute/Native/Trait/String.pm [moved from lib/Moose/Meta/Attribute/Trait/Native/String.pm with 91% similarity]
t/070_native_traits/000_load.t [moved from t/070_attribute_traits/000_load.t with 100% similarity]
t/070_native_traits/010_array_from_role.t [moved from t/070_attribute_traits/010_array_from_role.t with 100% similarity]
t/070_native_traits/011_counter_with_defaults.t [moved from t/070_attribute_traits/011_counter_with_defaults.t with 94% similarity]
t/070_native_traits/020_remove_attribute.t [moved from t/070_attribute_traits/020_remove_attribute.t with 100% similarity]
t/070_native_traits/100_collection_with_roles.t [moved from t/070_attribute_traits/100_collection_with_roles.t with 100% similarity]
t/070_native_traits/201_trait_counter.t [moved from t/070_attribute_traits/201_trait_counter.t with 96% similarity]
t/070_native_traits/202_trait_array.t [moved from t/070_attribute_traits/202_trait_array.t with 99% similarity]
t/070_native_traits/203_trait_hash.t [moved from t/070_attribute_traits/203_trait_hash.t with 98% similarity]
t/070_native_traits/204_trait_number.t [moved from t/070_attribute_traits/204_trait_number.t with 96% similarity]
t/070_native_traits/205_trait_list.t [moved from t/070_attribute_traits/205_trait_list.t with 98% similarity]
t/070_native_traits/207_trait_string.t [moved from t/070_attribute_traits/207_trait_string.t with 97% similarity]
t/070_native_traits/208_trait_bool.t [moved from t/070_attribute_traits/208_trait_bool.t with 100% similarity]

index 731b18a..dbbc38b 100644 (file)
@@ -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<Number|Moose::Meta::Attribute::Trait::Native::Number>
+=item L<Number|Moose::Meta::Attribute::Native::Trait::Number>
 
 Common numerical operations.
 
-=item L<String|Moose::Meta::Attribute::Trait::Native::String>
+=item L<String|Moose::Meta::Attribute::Native::Trait::String>
 
 Common methods for string operations.
 
-=item L<Counter|Moose::Meta::Attribute::Trait::Native::Counter>
+=item L<Counter|Moose::Meta::Attribute::Native::Trait::Counter>
 
 Methods for incrementing and decrementing a counter attribute.
 
-=item L<Bool|Moose::Meta::Attribute::Trait::Native::Bool>
+=item L<Bool|Moose::Meta::Attribute::Native::Trait::Bool>
 
 Common methods for boolean values.
 
-=item L<Hash|Moose::Meta::Attribute::Trait::Native::Hash>
+=item L<Hash|Moose::Meta::Attribute::Native::Trait::Hash>
 
 Common methods for hash references.
 
-=item L<ImmutableHash|Moose::Meta::Attribute::Trait::Native::ImmutableHash>
+=item L<ImmutableHash|Moose::Meta::Attribute::Native::Trait::ImmutableHash>
 
 Common methods for inspecting hash references.
 
-=item L<Array|Moose::Meta::Attribute::Trait::Native::Array>
+=item L<Array|Moose::Meta::Attribute::Native::Trait::Array>
 
 Common methods for array references.
 
-=item L<List|Moose::Meta::Attribute::Trait::Native::List>
+=item L<List|Moose::Meta::Attribute::Native::Trait::List>
 
 Common list methods for array references.
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
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 (file)
@@ -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
 
@@ -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<Moose::Meta::Attribute::Trait::Native::MethodProvider::Array>
+array operations. See L<Moose::Meta::Attribute::Native::MethodProvider::Array>
 for more details.
 
 =head1 METHODS
@@ -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
 
@@ -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
 
@@ -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<Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash>
+hash-like operations. See L<Moose::Meta::Attribute::Native::MethodProvider::Hash>
 for more details.
 
 =head1 METHODS
@@ -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
 
@@ -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
 
@@ -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' );
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 (file)
@@ -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' );
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 (file)
@@ -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,
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 (file)
@@ -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,
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 (file)
@@ -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,
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 (file)
@@ -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,
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 (file)
@@ -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',