r28953 - in /branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current: Changes MANIFEST META.yml lib/MooseX/Emulate/Class/Accessor/Fast.pm t/recreated_accessors.t

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Tue Dec 30 11:39:06 UTC 2008


Author: eloy
Date: Tue Dec 30 11:39:02 2008
New Revision: 28953

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28953
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-emulate-class-accessor-fast-perl (0.00700)

Added:
    branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/t/recreated_accessors.t
Modified:
    branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/Changes
    branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/MANIFEST
    branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/META.yml
    branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/lib/MooseX/Emulate/Class/Accessor/Fast.pm

Modified: branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/Changes?rev=28953&op=diff
==============================================================================
--- branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/Changes (original)
+++ branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/Changes Tue Dec 30 11:39:02 2008
@@ -1,3 +1,7 @@
+0.00700    Dec 29, 2008
+          - Creating a new accessor with the same name as an old one would result in
+            a new attribute with no reader/writer/accessor. Reported by t0m
+             - tests (t0m) 
 0.00600    Dec 17, 2008
           - Add test for a 'meta' accessor, which we need to treat as a 
             special case (t0m)

Modified: branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/MANIFEST?rev=28953&op=diff
==============================================================================
--- branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/MANIFEST (original)
+++ branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/MANIFEST Tue Dec 30 11:39:02 2008
@@ -20,3 +20,4 @@
 t/getset.t
 t/lib/TestAdoptCAF.pm
 t/no_replace_existing_symbols.t
+t/recreated_accessors.t

Modified: branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/META.yml?rev=28953&op=diff
==============================================================================
--- branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/META.yml Tue Dec 30 11:39:02 2008
@@ -19,4 +19,4 @@
   Moose: 0.31
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.00600
+version: 0.00700

Modified: branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/lib/MooseX/Emulate/Class/Accessor/Fast.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/lib/MooseX/Emulate/Class/Accessor/Fast.pm?rev=28953&op=diff
==============================================================================
--- branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/lib/MooseX/Emulate/Class/Accessor/Fast.pm (original)
+++ branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/lib/MooseX/Emulate/Class/Accessor/Fast.pm Tue Dec 30 11:39:02 2008
@@ -4,7 +4,7 @@
 use Class::MOP ();
 use Scalar::Util ();
 
-our $VERSION = '0.00600';
+our $VERSION = '0.00700';
 
 =head1 NAME
 
@@ -103,6 +103,8 @@
   my $self = shift;
   my $meta = $locate_metaclass->($self);
   for my $attr_name (@_){
+    $meta->remove_attribute($attr_name)
+      if $meta->find_attribute_by_name($attr_name);
     my $reader = $self->accessor_name_for($attr_name);
     my $writer = $self->mutator_name_for( $attr_name);
 
@@ -134,6 +136,8 @@
   my $self = shift;
   my $meta = $locate_metaclass->($self);
   for my $attr_name (@_){
+    $meta->remove_attribute($attr_name)
+      if $meta->find_attribute_by_name($attr_name);
     my $reader = $self->accessor_name_for($attr_name);
     my @opts = ($meta->has_method($reader) ? () : (reader => $reader) );
     my $attr = $meta->add_attribute($attr_name, @opts);
@@ -155,6 +159,8 @@
   my $self = shift;
   my $meta = $locate_metaclass->($self);
   for my $attr_name (@_){
+    $meta->remove_attribute($attr_name)
+      if $meta->find_attribute_by_name($attr_name);
     my $writer = $self->mutator_name_for($attr_name);
     my @opts = ($meta->has_method($writer) ? () : (writer => $writer) );
     my $attr = $meta->add_attribute($attr_name, @opts);

Added: branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/t/recreated_accessors.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/t/recreated_accessors.t?rev=28953&op=file
==============================================================================
--- branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/t/recreated_accessors.t (added)
+++ branches/upstream/libmoosex-emulate-class-accessor-fast-perl/current/t/recreated_accessors.t Tue Dec 30 11:39:02 2008
@@ -1,0 +1,32 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+use Test::More tests => 4;
+use Test::Exception;
+
+# 1
+use_ok('MooseX::Emulate::Class::Accessor::Fast');
+{
+  package My::Test::Package;
+  use Moose;
+  with 'MooseX::Emulate::Class::Accessor::Fast';
+  for (0..1) {
+    __PACKAGE__->mk_accessors(qw( foo ));
+    __PACKAGE__->mk_ro_accessors(qw( bar ));
+    __PACKAGE__->mk_wo_accessors(qw( baz ));
+  }
+}
+
+my $i = My::Test::Package->new(bar => 'bar');
+
+# 2
+lives_ok {
+  $i->foo('foo');
+  $i->baz('baz');
+
+  # 3-4
+  is($i->foo, 'foo');
+  is($i->bar, 'bar');
+} 'No exception';
+




More information about the Pkg-perl-cvs-commits mailing list