r40794 - in /trunk/libmoosex-methodattributes-perl: ./ debian/ lib/MooseX/ lib/MooseX/MethodAttributes/ lib/MooseX/MethodAttributes/Role/ lib/MooseX/MethodAttributes/Role/AttrContainer/ lib/MooseX/MethodAttributes/Role/Meta/ lib/MooseX/MethodAttributes/Role/Meta/Method/ t/ t/lib/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon Jul 27 02:07:20 UTC 2009
Author: jawnsy-guest
Date: Mon Jul 27 02:07:10 2009
New Revision: 40794
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=40794
Log:
* New upstream release
+ Add a hack to allow roles with method attributes to anonymous classes to
work if the user does a special handwave
* Added myself to Uploaders and Copyright
* Standards-Version 3.8.2 (no changes)
Added:
trunk/libmoosex-methodattributes-perl/t/lib/OtherRoleWithAttributes.pm
trunk/libmoosex-methodattributes-perl/t/lib/UsesMultipleRoles.pm
trunk/libmoosex-methodattributes-perl/t/multiple_roles.t
trunk/libmoosex-methodattributes-perl/t/multiple_roles2.t
trunk/libmoosex-methodattributes-perl/t/role_with_anon_class.t
Modified:
trunk/libmoosex-methodattributes-perl/Changes
trunk/libmoosex-methodattributes-perl/MANIFEST
trunk/libmoosex-methodattributes-perl/META.yml
trunk/libmoosex-methodattributes-perl/Makefile.PL
trunk/libmoosex-methodattributes-perl/README
trunk/libmoosex-methodattributes-perl/debian/changelog
trunk/libmoosex-methodattributes-perl/debian/control
trunk/libmoosex-methodattributes-perl/debian/copyright
trunk/libmoosex-methodattributes-perl/dist.ini
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Inheritable.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer/Inheritable.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Class.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Map.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/MaybeWrapped.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/Wrapped.pm
trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Role.pm
trunk/libmoosex-methodattributes-perl/t/lib/BaseClass.pm
trunk/libmoosex-methodattributes-perl/t/lib/ClassUsingRoleWithAttributes.pm
trunk/libmoosex-methodattributes-perl/t/lib/OtherSubClass.pm
trunk/libmoosex-methodattributes-perl/t/lib/RoleWithAttributes.pm
trunk/libmoosex-methodattributes-perl/t/lib/SubClass.pm
trunk/libmoosex-methodattributes-perl/t/lib/SubClassUseBaseAndUseMoose.pm
trunk/libmoosex-methodattributes-perl/t/lib/SubSubClass.pm
trunk/libmoosex-methodattributes-perl/t/lib/TestClass.pm
Modified: trunk/libmoosex-methodattributes-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/Changes?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/Changes (original)
+++ trunk/libmoosex-methodattributes-perl/Changes Mon Jul 27 02:07:10 2009
@@ -1,3 +1,15 @@
+0.15 Sun, Jul 26 18:02:05 2009 +0100
+ * Fix test which was failing in some cases and additional test cases.
+
+ * No other changes on the dev release.
+
+0.14_01 Thu, Jul 16 20:04:04 2009 +0100
+ * Add TODO tests for role combination with method attributes, proving that this doesn't work.
+
+ * Add nasty hack to allow the application of roles with method attributes to anon classes to
+ work if the user does a special handwave. This is less than optimum, see big block comment
+ in the code. :/
+
0.14 Sun, Jun 7 01:51:49 2009 +0100
* Fix bugs with composing roles with method attributes into other
roles with method attributes + tests
Modified: trunk/libmoosex-methodattributes-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/MANIFEST?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/MANIFEST (original)
+++ trunk/libmoosex-methodattributes-perl/MANIFEST Mon Jul 27 02:07:10 2009
@@ -26,14 +26,19 @@
t/inherited_non_moose_multilevel.t
t/lib/BaseClass.pm
t/lib/ClassUsingRoleWithAttributes.pm
+t/lib/OtherRoleWithAttributes.pm
t/lib/OtherSubClass.pm
t/lib/RoleWithAttributes.pm
t/lib/SubClass.pm
t/lib/SubClassUseBaseAndUseMoose.pm
t/lib/SubSubClass.pm
t/lib/TestClass.pm
+t/lib/UsesMultipleRoles.pm
+t/multiple_roles.t
+t/multiple_roles2.t
t/override_method_with_no_attribute.t
t/role.t
t/role_applied.t
t/role_in_role.t
-t/role_in_role_more.t
+t/role_in_role_more.t
+t/role_with_anon_class.t
Modified: trunk/libmoosex-methodattributes-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/META.yml?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/META.yml (original)
+++ trunk/libmoosex-methodattributes-perl/META.yml Mon Jul 27 02:07:10 2009
@@ -1,15 +1,19 @@
---
-abstract: code attribute introspection
+abstract: 'code attribute introspection'
author:
-- Florian Ragwitz <rafl at debian.org>
-- Tomas Doran <bobtfish at bobtfish.net>
-generated_by: Dist::Zilla::Plugin::MetaYaml version 1.091260
+ - 'Florian Ragwitz <rafl at debian.org>'
+ - 'Tomas Doran <bobtfish at bobtfish.net>'
+generated_by: 'Dist::Zilla::Plugin::MetaYAML version 1.091440'
license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
name: MooseX-MethodAttributes
requires:
- Moose: '0.79'
- MooseX::Types: '0.06'
- Test::Exception: '0'
- Test::More: '0'
- namespace::clean: '0'
-version: '0.14'
+ MRO::Compat: 0
+ Moose: 0.79
+ MooseX::Types: 0.06
+ Test::Exception: 0
+ Test::More: 0
+ namespace::clean: 0
+version: 0.15
Modified: trunk/libmoosex-methodattributes-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/Makefile.PL?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/Makefile.PL (original)
+++ trunk/libmoosex-methodattributes-perl/Makefile.PL Mon Jul 27 02:07:10 2009
@@ -8,15 +8,16 @@
DISTNAME => 'MooseX-MethodAttributes',
NAME => 'MooseX::MethodAttributes',
AUTHOR => 'Florian\ Ragwitz\ \<rafl\@debian\.org\>\,\ Tomas\ Doran\ \<bobtfish\@bobtfish\.net\>',
- ABSTRACT => 'code attribute introspection',
- VERSION => '0.14',
+ ABSTRACT => 'code\ attribute\ introspection',
+ VERSION => '0.15',
EXE_FILES => [ qw() ],
(eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
PREREQ_PM => {
+ "namespace::clean" => '0',
"Test::More" => '0',
- "namespace::clean" => '0',
"Test::Exception" => '0',
"MooseX::Types" => '0.06',
+ "MRO::Compat" => '0',
"Moose" => '0.79',
},
);
Modified: trunk/libmoosex-methodattributes-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/README?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/README (original)
+++ trunk/libmoosex-methodattributes-perl/README Mon Jul 27 02:07:10 2009
@@ -1,7 +1,7 @@
This archive contains the distribution MooseX-MethodAttributes, version
-0.14:
+0.15:
code attribute introspection
Modified: trunk/libmoosex-methodattributes-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/debian/changelog?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/debian/changelog (original)
+++ trunk/libmoosex-methodattributes-perl/debian/changelog Mon Jul 27 02:07:10 2009
@@ -1,3 +1,13 @@
+libmoosex-methodattributes-perl (0.15-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ + Add a hack to allow roles with method attributes to anonymous classes to
+ work if the user does a special handwave
+ * Added myself to Uploaders and Copyright
+ * Standards-Version 3.8.2 (no changes)
+
+ -- Jonathan Yu <frequency at cpan.org> Sun, 26 Jul 2009 18:03:46 -0400
+
libmoosex-methodattributes-perl (0.14-1) unstable; urgency=low
[ Ryan Niebur ]
Modified: trunk/libmoosex-methodattributes-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/debian/control?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/debian/control (original)
+++ trunk/libmoosex-methodattributes-perl/debian/control Mon Jul 27 02:07:10 2009
@@ -2,21 +2,21 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: libmoose-perl (>= 0.79), libnamespace-clean-perl,
- libmoosex-types-perl (>= 0.06), perl (>= 5.6.0-12)
+Build-Depends-Indep: perl (>= 5.6.0-16), libmoosex-types-perl (>= 0.06),
+ libmoose-perl (>= 0.79), libnamespace-clean-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ansgar Burchardt <ansgar at 43-1.org>,
- Krzysztof Krzyżaniak (eloy) <eloy at debian.org>,
- Brian Cassidy <brian.cassidy at gmail.com>, Ryan Niebur <ryanryan52 at gmail.com>
-Standards-Version: 3.8.1
+Uploaders: Krzysztof Krzyżaniak (eloy) <eloy at debian.org>,
+ Ansgar Burchardt <ansgar at 43-1.org>, Brian Cassidy <brian.cassidy at gmail.com>,
+ Ryan Niebur <ryanryan52 at gmail.com>, Jonathan Yu <frequency at cpan.org>
+Standards-Version: 3.8.2
Homepage: http://search.cpan.org/dist/MooseX-MethodAttributes/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libmoosex-methodattributes-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/
Package: libmoosex-methodattributes-perl
Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}, libmoose-perl (>= 0.79),
- libnamespace-clean-perl, libmoosex-types-perl (>= 0.06)
+Depends: ${misc:Depends}, ${perl:Depends}, libmoosex-types-perl (>= 0.06),
+ libmoose-perl (>= 0.79), libnamespace-clean-perl
Description: Perl module for code attribute introspection
MooseX::MethodAttributes allows code attributes of methods to be introspected
using Moose meta method objects.
Modified: trunk/libmoosex-methodattributes-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/debian/copyright?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/debian/copyright (original)
+++ trunk/libmoosex-methodattributes-perl/debian/copyright Mon Jul 27 02:07:10 2009
@@ -10,7 +10,7 @@
License: Artistic | GPL-1+
Files: debian/*
-Copyright:
+Copyright: 2009, Jonathan Yu <frequency at cpan.org>
2009, Ansgar Burchardt <ansgar at 43-1.org>
2009, Brian Cassidy <brian.cassidy at gmail.com>
License: Artistic | GPL-1+
Modified: trunk/libmoosex-methodattributes-perl/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/dist.ini?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/dist.ini (original)
+++ trunk/libmoosex-methodattributes-perl/dist.ini Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
name = MooseX-MethodAttributes
-version = 0.14
+version = 0.15
author = Florian Ragwitz <rafl at debian.org>
author = Tomas Doran <bobtfish at bobtfish.net>
license = Perl_5
@@ -11,6 +11,7 @@
MooseX::Types = 0.06
Test::Exception = 0
Test::More = 0
+MRO::Compat = 0
[@Filter]
bundle = @Classic
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes.pm Mon Jul 27 02:07:10 2009
@@ -2,7 +2,7 @@
use warnings;
package MooseX::MethodAttributes;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: code attribute introspection
@@ -40,7 +40,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 SYNOPSIS
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Inheritable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Inheritable.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Inheritable.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Inheritable.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Inheritable;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: inheritable code attribute introspection
@@ -23,7 +23,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 SYNOPSIS
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::AttrContainer;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: capture code attributes in the class' metaclass
@@ -24,7 +24,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 METHODS
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer/Inheritable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer/Inheritable.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer/Inheritable.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/AttrContainer/Inheritable.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::AttrContainer::Inheritable;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: capture code attributes in the automatically initialized metaclass instance
@@ -43,7 +43,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 DESCRIPTION
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Class.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Class.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Class.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::Meta::Class;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: metaclass role for storing code attributes
@@ -108,7 +108,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 METHODS
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Map.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Map.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Map.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Map.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::Meta::Map;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: role for storing code attributes
@@ -46,7 +46,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 METHODS
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::Meta::Method;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: metamethod role allowing code attribute introspection
@@ -34,7 +34,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 ATTRIBUTES
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/MaybeWrapped.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/MaybeWrapped.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/MaybeWrapped.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/MaybeWrapped.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: proxy attributes of wrapped methods if their metaclass supports it
@@ -30,7 +30,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 AUTHORS
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/Wrapped.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/Wrapped.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/Wrapped.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Method/Wrapped.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::Meta::Method::Wrapped;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: wrapped metamethod role allowing code attribute introspection
@@ -27,7 +27,7 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 METHODS
Modified: trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Role.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Role.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Role.pm (original)
+++ trunk/libmoosex-methodattributes-perl/lib/MooseX/MethodAttributes/Role/Meta/Role.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package MooseX::MethodAttributes::Role::Meta::Role;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
# ABSTRACT: metarole role for storing code attributes
@@ -43,8 +43,7 @@
does_role($thing, 'MooseX::MethodAttributes::Role::Meta::Class')
&& does_role($thing->method_metaclass, 'MooseX::MethodAttributes::Role::Meta::Method')
&& does_role($thing->wrapped_method_metaclass, 'MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped')) {
-
- Moose::Util::MetaRole::apply_metaclass_roles(
+ $thing = Moose::Util::MetaRole::apply_metaclass_roles(
for_class => $thing->name,
metaclass_roles => ['MooseX::MethodAttributes::Role::Meta::Class'],
method_metaclass_roles => ['MooseX::MethodAttributes::Role::Meta::Method'],
@@ -56,7 +55,7 @@
unless (
does_role( $thing->meta->name, __PACKAGE__ )
) {
- Moose::Util::MetaRole::apply_metaclass_roles(
+ $thing = Moose::Util::MetaRole::apply_metaclass_roles(
for_class => $thing->name,
metaclass_roles => [ __PACKAGE__ ],
);
@@ -70,15 +69,33 @@
}
# Note that the metaclass instance we started out with may have been turned
- # into lies by the role application process, so we explicitly re-fetch it
- # here.
- my $meta = find_meta($thing->name);
+ # into lies by the metatrait role application process, so we explicitly
+ # re-fetch it here.
- my $ret = $self->$orig($meta);
-
- push @{ $meta->_method_attribute_list }, @{ $self->_method_attribute_list };
- @{ $meta->_method_attribute_map }{ (keys(%{ $self->_method_attribute_map }), keys(%{ $meta->_method_attribute_map })) }
- = (values(%{ $self->_method_attribute_map }), values(%{ $meta->_method_attribute_map }));
+ # Alternatively, for epic shits and giggles, the meta trait application
+ # process (onto $thing) may have applied roles to our metaclass, but (if
+ # $thing is an anon class, not correctly replaced it in the metaclass cache.
+ # This results in the DESTROY method in Class::MOP::Class r(eap|ape)ing the
+ # package, which is unfortunate, as it removes all your methods and superclasses.
+ # Therefore, we avoid that by ramming the metaclass we've just been handed into
+ # the cache without weakening it.
+
+ # I'm fairly sure the 2nd part of that is a Moose bug, and should go away..
+ # Unfortunately, the implication of that is that whenever you apply roles to a class,
+ # the metaclass instance can change, and so needs to be re-retrieved or handed back
+ # to the caller :/
+ if ($thing->can('is_anon_class') and $thing->is_anon_class) {
+ Class::MOP::store_metaclass_by_name($thing->name, $thing);
+ }
+ else {
+ $thing = find_meta($thing->name);
+ }
+
+ my $ret = $self->$orig($thing);
+
+ push @{ $thing->_method_attribute_list }, @{ $self->_method_attribute_list };
+ @{ $thing->_method_attribute_map }{ (keys(%{ $self->_method_attribute_map }), keys(%{ $thing->_method_attribute_map })) }
+ = (values(%{ $self->_method_attribute_map }), values(%{ $thing->_method_attribute_map }));
return $ret;
};
@@ -98,12 +115,12 @@
=head1 VERSION
-version 0.14
+version 0.15
=head1 SYNOPSIS
package MyRole;
- use Moose::Role -traits => 'MooseX::MethodAttributes::Role::Meta::Role';
+ use Moose::Role -traits => 'MethodAttributes';
sub foo : Bar Baz('corge') { ... }
@@ -121,10 +138,6 @@
These attributes can then be found later once the methods are composed
into a class.
-Note that currently roles with attributes cannot have methods excluded
-or aliased, and will in turn confer this property onto any roles they
-are composed onto.
-
=head1 AUTHORS
Florian Ragwitz <rafl at debian.org>
@@ -137,3 +150,21 @@
This is free software; you can redistribute it and/or modify it under
the same terms as perl itself.
+=head1 CAVEATS
+
+=over
+
+=item *
+
+Currently roles with attributes cannot have methods excluded
+or aliased, and will in turn confer this property onto any roles they
+are composed onto.
+
+=item *
+
+Composing multiple roles with attributes onto a class at once will fail
+to work as expected, therefore conflict resolution cannot be taken advantage
+of.
+
+=back
+
Modified: trunk/libmoosex-methodattributes-perl/t/lib/BaseClass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/BaseClass.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/BaseClass.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/BaseClass.pm Mon Jul 27 02:07:10 2009
@@ -2,12 +2,12 @@
use warnings;
package BaseClass::Meta::Role;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use Moose::Role;
package BaseClass;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use Moose;
Modified: trunk/libmoosex-methodattributes-perl/t/lib/ClassUsingRoleWithAttributes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/ClassUsingRoleWithAttributes.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/ClassUsingRoleWithAttributes.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/ClassUsingRoleWithAttributes.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package ClassUsingRoleWithAttributes;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use Moose;
# FIXME - This should not have to be here.
Added: trunk/libmoosex-methodattributes-perl/t/lib/OtherRoleWithAttributes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/OtherRoleWithAttributes.pm?rev=40794&op=file
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/OtherRoleWithAttributes.pm (added)
+++ trunk/libmoosex-methodattributes-perl/t/lib/OtherRoleWithAttributes.pm Mon Jul 27 02:07:10 2009
@@ -1,0 +1,10 @@
+package OtherRoleWithAttributes;
+our $VERSION = '0.15';
+
+use Moose::Role -traits => 'MethodAttributes';
+use namespace::clean -except => 'meta';
+
+sub bar : AnAttr { 'bar' }
+
+1;
+
Modified: trunk/libmoosex-methodattributes-perl/t/lib/OtherSubClass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/OtherSubClass.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/OtherSubClass.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/OtherSubClass.pm Mon Jul 27 02:07:10 2009
@@ -2,7 +2,7 @@
use warnings;
package OtherSubClass;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use base qw/BaseClass/;
Modified: trunk/libmoosex-methodattributes-perl/t/lib/RoleWithAttributes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/RoleWithAttributes.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/RoleWithAttributes.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/RoleWithAttributes.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package RoleWithAttributes;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use Moose::Role -traits => 'MethodAttributes';
use namespace::clean -except => 'meta';
Modified: trunk/libmoosex-methodattributes-perl/t/lib/SubClass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/SubClass.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/SubClass.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/SubClass.pm Mon Jul 27 02:07:10 2009
@@ -2,7 +2,7 @@
use warnings;
package SubClass;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use Moose;
Modified: trunk/libmoosex-methodattributes-perl/t/lib/SubClassUseBaseAndUseMoose.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/SubClassUseBaseAndUseMoose.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/SubClassUseBaseAndUseMoose.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/SubClassUseBaseAndUseMoose.pm Mon Jul 27 02:07:10 2009
@@ -2,7 +2,7 @@
use warnings;
package SubClassUseBaseAndUseMoose;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use base qw/BaseClass/;
Modified: trunk/libmoosex-methodattributes-perl/t/lib/SubSubClass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/SubSubClass.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/SubSubClass.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/SubSubClass.pm Mon Jul 27 02:07:10 2009
@@ -2,7 +2,7 @@
use warnings;
package SubSubClass;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use base qw/OtherSubClass/;
Modified: trunk/libmoosex-methodattributes-perl/t/lib/TestClass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/TestClass.pm?rev=40794&op=diff
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/TestClass.pm (original)
+++ trunk/libmoosex-methodattributes-perl/t/lib/TestClass.pm Mon Jul 27 02:07:10 2009
@@ -1,5 +1,5 @@
package TestClass;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use Moose;
@@ -12,7 +12,7 @@
after foo => sub {};
package SubClass;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
use Moose;
Added: trunk/libmoosex-methodattributes-perl/t/lib/UsesMultipleRoles.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/lib/UsesMultipleRoles.pm?rev=40794&op=file
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/lib/UsesMultipleRoles.pm (added)
+++ trunk/libmoosex-methodattributes-perl/t/lib/UsesMultipleRoles.pm Mon Jul 27 02:07:10 2009
@@ -1,0 +1,13 @@
+package UsesMultipleRoles;
+our $VERSION = '0.15';
+
+use Moose;
+use namespace::clean -except => 'meta';
+
+with qw/
+ RoleWithAttributes
+ OtherRoleWithAttributes
+/;
+
+__PACKAGE__->meta->make_immutable;
+
Added: trunk/libmoosex-methodattributes-perl/t/multiple_roles.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/multiple_roles.t?rev=40794&op=file
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/multiple_roles.t (added)
+++ trunk/libmoosex-methodattributes-perl/t/multiple_roles.t Mon Jul 27 02:07:10 2009
@@ -1,0 +1,35 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+
+use Test::More tests => 5;
+
+use MooseX::MethodAttributes ();
+
+use UsesMultipleRoles;
+
+my $meta = UsesMultipleRoles->meta;
+
+my $foo = $meta->get_method('foo');
+ok $foo, 'Got foo method';
+
+my $bar = $meta->get_method('bar');
+ok $bar, 'Got bar method';
+
+TODO: {
+ local $TODO = "Does not work yet";
+ SKIP: {
+ ok $meta->can('get_method_attributes')
+ or skip 'Cannot call get_method_attributes method on class', 2;
+
+ my @foo_attrs = $meta->get_method_attributes($foo->body);
+ ok @foo_attrs;
+
+ my @bar_attrs = $meta->get_method_attributes($bar->body);
+ ok @bar_attrs;
+ }
+}
+
Added: trunk/libmoosex-methodattributes-perl/t/multiple_roles2.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/multiple_roles2.t?rev=40794&op=file
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/multiple_roles2.t (added)
+++ trunk/libmoosex-methodattributes-perl/t/multiple_roles2.t Mon Jul 27 02:07:10 2009
@@ -1,0 +1,60 @@
+use strict;
+use warnings;
+use MooseX::MethodAttributes ();
+
+use Test::More tests => 2;
+
+{
+ package Bar;
+ use Moose::Role -traits => 'MethodAttributes';
+ use namespace::clean -except => 'meta';
+
+ sub item :Chained(/app/root) PathPrefix CaptureArgs(1) { }
+}
+
+{
+ package Foo;
+ use Moose::Role -traits => 'MethodAttributes';
+ use namespace::clean -except => 'meta';
+
+ sub live :Chained(item) PathPart Args(0) { }
+ sub foo :Attr { }
+ sub other :Attr { }
+}
+
+{
+ package Catalyst::Controller;
+ use Moose;
+ use namespace::clean -except => 'meta';
+
+ BEGIN { extends qw/MooseX::MethodAttributes::Inheritable/; }
+}
+
+use Moose::Util;
+use Moose::Meta::Class;;
+
+Moose::Meta::Class->create("MyClass",
+ superclasses => [qw/Catalyst::Controller/],
+ roles => ["Bar", "Foo"],
+);
+
+TODO: {
+ local $TODO = 'Does not work yet';
+ SKIP: {
+ ok MyClass->meta->can('get_all_methods_with_attributes')
+ or skip 'Role combination and method attributes known broken', 1;
+
+ my @methods;
+ for my $method (sort { $a->name cmp $b->name } MyClass->meta->get_all_methods_with_attributes) {
+ push(@methods, $method->name . " :" . join("|", @{ $method->attributes }));
+ }
+
+ is_deeply \@methods, [
+ 'foo :Attr',
+ 'item :Chained(/app/root)|PathPrefix|CaptureArgs(1)',
+ 'live :Chained(item)|PathPart|Args(0)',
+ 'other :Attr',
+ ], 'methods with expected attributes found';
+ }
+}
+
Added: trunk/libmoosex-methodattributes-perl/t/role_with_anon_class.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-methodattributes-perl/t/role_with_anon_class.t?rev=40794&op=file
==============================================================================
--- trunk/libmoosex-methodattributes-perl/t/role_with_anon_class.t (added)
+++ trunk/libmoosex-methodattributes-perl/t/role_with_anon_class.t Mon Jul 27 02:07:10 2009
@@ -1,0 +1,46 @@
+use strict;
+use warnings;
+use Moose::Util qw/find_meta/;
+use Moose::Meta::Class;
+use MooseX::MethodAttributes ();
+use Test::More tests => 9;
+use MRO::Compat;
+
+{
+ package My::Role;
+ use Moose::Role -traits => 'MethodAttributes';
+
+ sub foo : Bar {}
+}
+{
+ package My::SuperClass;
+ use Moose;
+
+ sub bar {}
+}
+
+my $meta = Moose::Meta::Class->create_anon_class(
+ superclasses => ['My::SuperClass'],
+ roles => ['My::Role'],
+ cache => 1
+);
+
+# FIXME - Note special move here, required
+# as you get the original metaclass
+# back, not the one with the roles
+# appled.
+my $other_meta = find_meta($meta->name);
+
+ok $other_meta;
+my $classname = $other_meta->name;
+isa_ok $classname->new, 'My::SuperClass';
+isa_ok $classname->new, 'Moose::Object';
+my @mro = @{ mro::get_linear_isa($classname) };
+is $mro[1], 'My::SuperClass';
+is $mro[2], 'Moose::Object';
+ok $classname->can('foo');
+ok $classname->can('new');
+ok $classname->can('bar');
+my $attr = $other_meta->get_method_attributes( $classname->can('foo') );
+is_deeply $attr, ['Bar'];
+
More information about the Pkg-perl-cvs-commits
mailing list