[libmoosex-semiaffordanceaccessor-perl] 01/10: add applied_attribute metarole

Intrigeri intrigeri at moszumanska.debian.org
Thu Aug 28 15:44:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to annotated tag v0.09
in repository libmoosex-semiaffordanceaccessor-perl.

commit 080d1e6df9e616302eb2294b6767a5676cba8c82
Author: Jesse Luehrs <doy at tozt.net>
Date:   Sat Oct 9 15:50:27 2010 -0500

    add applied_attribute metarole
---
 Changes                              |  2 ++
 dist.ini                             |  2 +-
 lib/MooseX/SemiAffordanceAccessor.pm |  3 +++
 t/basic.t                            | 16 ++++++++++++++++
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/Changes b/Changes
index 1c77210..31e9e55 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+- Allow MooseX::SemiAffordanceAccessor to be used in roles.
+
 0.08   2010-07-20
 
 - Fix a bad example in the SYNOPSIS.
diff --git a/dist.ini b/dist.ini
index d49b7bb..d5ccb3a 100644
--- a/dist.ini
+++ b/dist.ini
@@ -29,7 +29,7 @@ repository.type   = git
 [CheckChangeLog]
 
 [Prereqs]
-Moose = 0.94
+Moose = 1.16
 
 [Prereqs / TestRequires]
 Test::More = 0.88
diff --git a/lib/MooseX/SemiAffordanceAccessor.pm b/lib/MooseX/SemiAffordanceAccessor.pm
index b3b40b8..f1a5834 100644
--- a/lib/MooseX/SemiAffordanceAccessor.pm
+++ b/lib/MooseX/SemiAffordanceAccessor.pm
@@ -12,6 +12,9 @@ Moose::Exporter->setup_import_methods(
     class_metaroles => {
         attribute => ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
     },
+    role_metaroles => {
+        applied_attribute => ['MooseX::SemiAffordanceAccessor::Role::Attribute'],
+    },
 );
 
 1;
diff --git a/t/basic.t b/t/basic.t
index 520561c..dc5c65f 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -68,4 +68,20 @@ ok( SAA3->can('set_it'),      'SAA3->set_it does exist' );
 ok( !SAA4->can('bare'),     'SAA4->bare does not exist' );
 ok( !SAA4->can('set_bare'), 'SAA4->set_bare does not exist' );
 
+{
+    package SAA::Role;
+    use Moose::Role;
+    use MooseX::SemiAffordanceAccessor;
+    has foo => (is => 'rw');
+}
+
+{
+    package SAA::WithRole;
+    use Moose;
+    with 'SAA::Role';
+}
+
+ok( SAA::WithRole->can('foo'), "roles work" );
+ok( SAA::WithRole->can('set_foo'), "roles work" );
+
 done_testing();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoosex-semiaffordanceaccessor-perl.git



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