r52190 - 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/

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Fri Feb 5 09:37:32 UTC 2010


Author: carnil-guest
Date: Fri Feb  5 09:37:21 2010
New Revision: 52190

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

Removed:
    branches/upstream/libmoosex-role-parameterized-perl/current/t/200-curried-parameterized-role.t
Modified:
    branches/upstream/libmoosex-role-parameterized-perl/current/Changes
    branches/upstream/libmoosex-role-parameterized-perl/current/META.yml
    branches/upstream/libmoosex-role-parameterized-perl/current/Makefile.PL
    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
    branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Tutorial.pod

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=52190&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/Changes (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/Changes Fri Feb  5 09:37:21 2010
@@ -1,4 +1,10 @@
 Changes for MooseX-Role-Parameterized
+
+0.16  February 4, 2010
+    * Allow specifying custom metaclasses for parameterized
+      roles (Oliver Charles)
+
+    * Documentation improvements (Oliver Charles, Sartak)
 
 0.15  January 5, 2010
     * Move the guts of MXRPMR::Parameterized into a trait. See

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=52190&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/META.yml Fri Feb  5 09:37:21 2010
@@ -25,4 +25,4 @@
   perl: 5.8.1
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.15
+version: 0.16

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/Makefile.PL?rev=52190&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/Makefile.PL (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/Makefile.PL Fri Feb  5 09:37:21 2010
@@ -6,11 +6,10 @@
 all_from       'lib/MooseX/Role/Parameterized.pm';
 githubmeta;
 
-requires       'Moose' => '0.78';
-test_requires  'Test::Moose';
-test_requires  'Test::More' => '0.88';
-
-build_requires 'Test::Exception' => '0.27';
+requires      'Moose' => '0.78';
+test_requires 'Test::Moose';
+test_requires 'Test::More' => '0.88';
+test_requires 'Test::Exception' => '0.27';
 
 WriteAll;
 

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=52190&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  5 09:37:21 2010
@@ -7,7 +7,7 @@
 
 use MooseX::Role::Parameterized::Meta::Role::Parameterizable;
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 our $CURRENT_METACLASS;
 
 Moose::Exporter->setup_import_methods(
@@ -43,10 +43,10 @@
 
 sub init_meta {
     my $self = shift;
-
-    return Moose::Role->init_meta(@_,
-        metaclass => 'MooseX::Role::Parameterized::Meta::Role::Parameterizable',
-    );
+    my %options = @_;
+    $options{metaclass} ||= 'MooseX::Role::Parameterized::Meta::Role::Parameterizable';
+
+    return Moose::Role->init_meta(%options);
 }
 
 sub has {

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=52190&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  5 09:37:21 2010
@@ -2,7 +2,7 @@
 use Moose;
 extends 'Moose::Meta::Attribute';
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 
 # 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=52190&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  5 09:37:21 2010
@@ -2,7 +2,7 @@
 use Moose;
 extends 'Moose::Meta::Role';
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 
 use MooseX::Role::Parameterized::Meta::Role::Parameterized;
 use MooseX::Role::Parameterized::Meta::Parameter;
@@ -79,7 +79,10 @@
     confess "A role generator is required to generate roles"
         unless $self->has_role_generator;
 
-    my $role = $self->parameterized_role_metaclass->create_anon_role(
+    my $parameterized_role_metaclass = $self->parameterized_role_metaclass;
+    Class::MOP::load_class($parameterized_role_metaclass);
+
+    my $role = $parameterized_role_metaclass->create_anon_role(
         genitor    => $self,
         parameters => $parameters,
     );

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=52190&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  5 09:37:21 2010
@@ -3,7 +3,7 @@
 extends 'Moose::Meta::Role';
 with 'MooseX::Role::Parameterized::Meta::Trait::Parameterized';
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 
 __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=52190&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  5 09:37:21 2010
@@ -1,7 +1,7 @@
 package MooseX::Role::Parameterized::Meta::Trait::Parameterized;
 use Moose::Role;
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 
 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=52190&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  5 09:37:21 2010
@@ -1,7 +1,7 @@
 package MooseX::Role::Parameterized::Parameters;
 use Moose;
 
-our $VERSION = '0.15';
+our $VERSION = '0.16';
 
 __PACKAGE__->meta->make_immutable;
 no Moose;

Modified: branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Tutorial.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Tutorial.pod?rev=52190&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Tutorial.pod (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/lib/MooseX/Role/Parameterized/Tutorial.pod Fri Feb  5 09:37:21 2010
@@ -13,7 +13,7 @@
 While combining roles affords you a great deal of flexibility, individual roles
 have very little in the way of configurability. Core Moose provides C<alias>
 for renaming methods and C<excludes> for ignoring methods. These options are
-primarily (perhaps solely) for disambiguating role conflicts. See
+primarily (perhaps solely) for resolving role conflicts. See
 L<Moose::Cookbook::Roles::Recipe2> for more about C<alias> and C<excludes>.
 
 Because roles serve many different masters, they usually provide only the least
@@ -22,7 +22,7 @@
 needs to know which method to call when it is done. Or what default value to
 use for its C<url> attribute.
 
-Parameterized roles offer exactly this solution.
+Parameterized roles offer a solution to these (and other) kinds of problems.
 
 =head1 USAGE
 
@@ -50,8 +50,9 @@
 =head3 C<parameter>
 
 Inside your parameterized role, you specify a set of parameters. This is
-exactly like specifying the attributes of a class. Instead of C<has> you use
-the keyword C<parameter>, but your parameters can use any options to C<has>.
+exactly like specifying the attributes of a class. Instead of L<Moose/has> you
+use the keyword C<parameter>, but your parameters can use any options to
+C<has>.
 
     parameter 'delegation' => (
         isa       => 'HashRef|ArrayRef|RegexpRef',
@@ -61,15 +62,20 @@
 You do have to declare what parameters you accept, just like you have to
 declare what attributes you accept for regular Moose objects.
 
+One departure from C<has> is that we create a reader accessor for you by
+default. In other words, we assume C<< is => 'ro' >>. If you do not want an
+accessor, you can use C<< is => 'bare' >>.
+
 =head3 C<role>
 
 C<role> takes a block of code that will be used to generate your role with its
-parameters bound. Here is where you declare parameterized components: use
-C<has>, method modifiers, and so on. The C<role> block receives an argument,
-which contains the parameters specified by C<with>. You can access the
-parameters just like regular attributes on that object.
-
-Each time you compose this parameterized role, the role {} block will be
+parameters bound. Here is where you declare components that depend on
+parameters. You can declare attributes, methods, modifiers, etc. The first
+argument to the C<role> is an object containing the parameters specified by
+C<with>. You can access the parameters just like regular attributes on that
+object.
+
+Each time you compose this parameterized role, the C<role {}> block will be
 executed. It will receive a new parameter object and produce an entirely new
 role. That's the whole point, after all.
 
@@ -112,9 +118,9 @@
 
 =item Inform a role of your class' attributes and methods
 
-Core roles can require only methods with specific names. Now your roles can
-require that you specify a method name you wish the role to instrument, or
-which attributes to dump to a file.
+Core roles can only require methods with specific names chosen by the role. Now
+your roles can demand that the class specifies a method name you wish the role to
+instrument, or which attributes to dump to a file.
 
     parameter instrument_method => (
         isa      => 'Str',




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