From: Hans Dieter Pearcey Date: Sun, 6 Sep 2009 22:57:18 +0000 (-0400) Subject: rename Hash->empty => is_empty X-Git-Tag: 0.89_02~33^2~5^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb023e1502c774e259e935cf15d390db67e10f9c;p=gitmo%2FMoose.git rename Hash->empty => is_empty --- diff --git a/Changes b/Changes index f6b74d4..7d27713 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ Also see Moose::Manual::Delta for more details of, and workarounds for, noteworthy changes. +0.89_02 + * Moose::Meta::Attribute::Native + - Fix Hash, which still had 'empty' instead of 'is_empty'. (hdp) + 0.89_01 Wed Sep 2, 2009 * Moose::Meta::Attribute - Added the currying syntax for delegation from AttributeHelpers to the diff --git a/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm index 575e84f..9baffa1 100644 --- a/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Hash.pm @@ -59,7 +59,7 @@ sub count : method { return sub { scalar CORE::keys %{ $reader->( $_[0] ) } }; } -sub empty : method { +sub is_empty : method { my ( $attr, $reader, $writer ) = @_; return sub { scalar CORE::keys %{ $reader->( $_[0] ) } ? 0 : 1 }; } diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm index df9d997..9d57157 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Hash.pm @@ -44,7 +44,7 @@ Moose::Meta::Attribute::Native::Trait::Hash handles => { set_option => 'set', get_option => 'get', - has_no_options => 'empty', + has_no_options => 'is_empty', num_options => 'count', delete_option => 'delete', pairs => 'kv', @@ -111,7 +111,7 @@ Resets the hash to an empty value, like C<%hash = ()>. Returns the number of elements in the hash. -=item B +=item B If the hash is populated, returns false. Otherwise, returns true. diff --git a/t/070_native_traits/203_trait_hash.t b/t/070_native_traits/203_trait_hash.t index 3af65b5..ef93bc4 100644 --- a/t/070_native_traits/203_trait_hash.t +++ b/t/070_native_traits/203_trait_hash.t @@ -19,7 +19,7 @@ use Test::Moose 'does_ok'; handles => { 'set_option' => 'set', 'get_option' => 'get', - 'has_no_options' => 'empty', + 'has_no_options' => 'is_empty', 'num_options' => 'count', 'clear_options' => 'clear', 'delete_option' => 'delete', @@ -148,7 +148,7 @@ is_deeply( { 'set_option' => 'set', 'get_option' => 'get', - 'has_no_options' => 'empty', + 'has_no_options' => 'is_empty', 'num_options' => 'count', 'clear_options' => 'clear', 'delete_option' => 'delete',