r52633 - in /branches/upstream/libmoosex-role-parameterized-perl/current: ./ lib/MooseX/Role/ lib/MooseX/Role/Parameterized/ lib/MooseX/Role/Parameterized/Meta/ lib/MooseX/Role/Parameterized/Meta/Role/ lib/MooseX/Role/Parameterized/Meta/Trait/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Fri Feb 12 03:07:56 UTC 2010


Author: jawnsy-guest
Date: Fri Feb 12 03:07:43 2010
New Revision: 52633

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52633
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-role-parameterized-perl (0.17)

Added:
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Extending.pod
    branches/upstream/libmoosex-role-parameterized-perl/current/t/019-custom-metaclass.t
Modified:
    branches/upstream/libmoosex-role-parameterized-perl/current/Changes
    branches/upstream/libmoosex-role-parameterized-perl/current/MANIFEST
    branches/upstream/libmoosex-role-parameterized-perl/current/META.yml
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized.pm
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Parameter.pm
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Parameters.pm

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/Changes?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/Changes (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/Changes Fri Feb 12 03:07:43 2010
@@ -1,4 +1,7 @@
 Changes for MooseX-Role-Parameterized
+
+0.17  February 11, 2010
+    * MANIFEST fixes (Karen Etheridge)
 
 0.16  February 4, 2010
     * Allow specifying custom metaclasses for parameterized

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/MANIFEST?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/MANIFEST (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/MANIFEST Fri Feb 12 03:07:43 2010
@@ -8,6 +8,7 @@
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
 lib/MooseX/Role/Parameterized.pm
+lib/MooseX/Role/Parameterized/Extending.pod
 lib/MooseX/Role/Parameterized/Meta/Parameter.pm
 lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
 lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm
@@ -35,9 +36,9 @@
 t/016-trait.t
 t/017-current_metaclass.t
 t/018-parameter-roles.t
+t/019-custom-metaclass.t
 t/100-erroneous-keywords.t
 t/101-alias-excludes.t
 t/102-nested.t
 t/150-composite-role-application.t
-t/200-curried-parameterized-role.t
 t/lib/Bar.pm

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/META.yml?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/META.yml Fri Feb 12 03:07:43 2010
@@ -25,4 +25,4 @@
   perl: 5.8.1
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.16
+version: 0.17

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized.pm?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized.pm (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized.pm Fri Feb 12 03:07:43 2010
@@ -7,7 +7,7 @@
 
 use MooseX::Role::Parameterized::Meta::Role::Parameterizable;
 
-our $VERSION = '0.16';
+our $VERSION = '0.17';
 our $CURRENT_METACLASS;
 
 Moose::Exporter->setup_import_methods(
@@ -226,6 +226,9 @@
 a consistent enough API); I believe this to be the easiest and most flexible
 design. Coincidentally, Pugs originally had an eerily similar design.
 
+See L<MooseX::Role::Parameterized::Extending> for some tips on how to extend
+this module.
+
 =head2 Why a parameters object?
 
 I've been asked several times "Why use a parameter I<object> and not just a

Added: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Extending.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Extending.pod?rev=52633&op=file
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Extending.pod (added)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Extending.pod Fri Feb 12 03:07:43 2010
@@ -1,0 +1,40 @@
+=pod
+
+=head1 NAME
+
+MooseX::Role::Parameterized::Extending - extending MooseX::Role::Parameterized roles
+
+=head1 DESCRIPTION
+
+There are heaps of useful modules in the MooseX namespace that you can use to
+make your roles more powerful. However, they do not always work out of the box
+with MooseX::Role::Parameterized, but it's fairlystraight forward to achieve
+the functionality you desire.
+
+MooseX::Role::Parameterized was designed to be extensible, and it is now
+possible to apply custom traits to the generated role, giving them the
+functionality provided in MooseX modules. In this example, we will look at
+applying the fake trait 'MooseX::MagicRole' to a parameterized role.
+
+The first we need to do is define a new metaclass for our parameterized role.
+To get MooseX::Role::Parameterized to apply this metaclass to our roles, we
+need a little bit of glue first:
+
+    package MyApp::Meta::Role::Parameterizable;
+    use Moose;
+    extends 'MooseX::Role::Parameterized::Meta::Role::Parameterizable';
+    sub parameterized_role_metaclass { 'MyApp::Meta::Role::Parameterized' }
+
+Now we can take advantage of this by specifying our glue metaclass to
+MooseX::Role::Parameterized:
+
+    package MyApp::Role;
+    use MooseX::Role::Parameterized -metaclass => 'MyApp::Meta::Role::Parameterizable';
+
+    role {
+    }
+
+And there you go! MyApp::Role now has the MooseX::MagicRole trait applied.
+
+=cut
+

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Parameter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Parameter.pm?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Parameter.pm (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Parameter.pm Fri Feb 12 03:07:43 2010
@@ -2,7 +2,7 @@
 use Moose;
 extends 'Moose::Meta::Attribute';
 
-our $VERSION = '0.16';
+our $VERSION = '0.17';
 
 # This doesn't actually do anything because _process_options does not consult
 # the default value of "is". hrm.

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm Fri Feb 12 03:07:43 2010
@@ -2,7 +2,7 @@
 use Moose;
 extends 'Moose::Meta::Role';
 
-our $VERSION = '0.16';
+our $VERSION = '0.17';
 
 use MooseX::Role::Parameterized::Meta::Role::Parameterized;
 use MooseX::Role::Parameterized::Meta::Parameter;

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Role/Parameterized.pm Fri Feb 12 03:07:43 2010
@@ -3,7 +3,7 @@
 extends 'Moose::Meta::Role';
 with 'MooseX::Role::Parameterized::Meta::Trait::Parameterized';
 
-our $VERSION = '0.16';
+our $VERSION = '0.17';
 
 __PACKAGE__->meta->make_immutable;
 no Moose;

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm Fri Feb 12 03:07:43 2010
@@ -1,7 +1,7 @@
 package MooseX::Role::Parameterized::Meta::Trait::Parameterized;
 use Moose::Role;
 
-our $VERSION = '0.16';
+our $VERSION = '0.17';
 
 use MooseX::Role::Parameterized::Parameters;
 

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Parameters.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Parameters.pm?rev=52633&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Parameters.pm (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Parameters.pm Fri Feb 12 03:07:43 2010
@@ -1,7 +1,7 @@
 package MooseX::Role::Parameterized::Parameters;
 use Moose;
 
-our $VERSION = '0.16';
+our $VERSION = '0.17';
 
 __PACKAGE__->meta->make_immutable;
 no Moose;

Added: branches/upstream/libmoosex-role-parameterized-perl/current/t/019-custom-metaclass.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/t/019-custom-metaclass.t?rev=52633&op=file
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/t/019-custom-metaclass.t (added)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/t/019-custom-metaclass.t Fri Feb 12 03:07:43 2010
@@ -1,0 +1,45 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+use Test::Moose;
+
+do {
+    package MyTrait;
+    use Moose::Role;
+};
+
+BEGIN {
+    do {
+        package Parameterized;
+        use Moose;
+        extends 'Moose::Meta::Role';
+        with 'MooseX::Role::Parameterized::Meta::Trait::Parameterized';
+        with 'MyTrait';
+    };
+
+    do {
+        package Parameterizable;
+        use Moose;
+        extends 'MooseX::Role::Parameterized::Meta::Role::Parameterizable';
+        sub parameterized_role_metaclass { 'Parameterized' }
+    };
+}
+
+do {
+    package MyRole;
+    use MooseX::Role::Parameterized -metaclass => 'Parameterizable';
+
+    role {
+        my ($params, %extra) = @_;
+        ::does_ok($extra{operating_on}, 'MyTrait', 'parameterized role should do the MyTrait trait');
+    }
+};
+
+do {
+    package MyClass;
+    use Moose;
+    with 'MyRole';
+};
+
+MyClass->new;




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