r42184 - in /branches/upstream/libmoosex-role-parameterized-perl/current: ./ lib/MooseX/Role/ lib/MooseX/Role/Parameterized/ lib/MooseX/Role/Parameterized/Meta/Role/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Thu Aug 20 18:13:45 UTC 2009
Author: jawnsy-guest
Date: Thu Aug 20 18:13:40 2009
New Revision: 42184
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=42184
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-role-parameterized-perl (0.12)
Added:
branches/upstream/libmoosex-role-parameterized-perl/current/t/017-current_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/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/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/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=42184&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/Changes (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/Changes Thu Aug 20 18:13:40 2009
@@ -1,4 +1,17 @@
Changes for MooseX-Role-Parameterized
+
+0.12 Aug 15, 2009
+ * Add MooseX::Role::Parameterized->current_metaclass for forward compat
+ (Sartak)
+
+ * Various documentation improvements (Sartak)
+
+0.11 Aug 9, 2009
+ * Explicitly test-require Test::Moose for Fedora packaging (RSRCHBOY)
+
+ * Finally a sensible synopsis (Sartak)
+
+ * More examples are always good :) (Sartak)
0.10 Jun 25, 2009
* Fix test that now warns in Moose (Sartak)
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=42184&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/MANIFEST (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/MANIFEST Thu Aug 20 18:13:40 2009
@@ -33,6 +33,7 @@
t/014-compose-parameterizable.t
t/015-compose-keywords.t
t/016-trait.t
+t/017-current_metaclass.t
t/100-erroneous-keywords.t
t/101-alias-excludes.t
t/150-composite-role-application.t
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=42184&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/META.yml Thu Aug 20 18:13:40 2009
@@ -1,10 +1,11 @@
---
-abstract: 'parameterized roles'
+abstract: 'roles with composition parameters'
author:
- 'Shawn M Moore, C<sartak at gmail.com>'
build_requires:
ExtUtils::MakeMaker: 6.42
Test::Exception: 0.27
+ Test::Moose: 0
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
@@ -20,8 +21,9 @@
- t
requires:
Moose: 0.78
+ perl: 5.8.1
resources:
homepage: http://github.com/sartak/MooseX-Role-Parameterized/tree
license: http://dev.perl.org/licenses/
repository: git://github.com/sartak/MooseX-Role-Parameterized.git
-version: 0.10
+version: 0.12
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=42184&op=diff
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/Makefile.PL (original)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/Makefile.PL Thu Aug 20 18:13:40 2009
@@ -7,6 +7,7 @@
githubmeta;
requires 'Moose' => '0.78';
+test_requires 'Test::Moose';
build_requires 'Test::Exception' => '0.27';
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=42184&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 Thu Aug 20 18:13:40 2009
@@ -1,4 +1,5 @@
package MooseX::Role::Parameterized;
+use 5.008001;
use Moose::Role ();
use Moose::Exporter;
use Carp 'confess';
@@ -6,7 +7,7 @@
use MooseX::Role::Parameterized::Meta::Role::Parameterizable;
-our $VERSION = '0.10';
+our $VERSION = '0.12';
our $CURRENT_METACLASS;
Moose::Exporter->setup_import_methods(
@@ -16,6 +17,8 @@
as_is => [ 'confess', 'blessed' ],
);
+sub current_metaclass { $CURRENT_METACLASS }
+
sub parameter {
my $caller = shift;
@@ -153,7 +156,7 @@
=head1 NAME
-MooseX::Role::Parameterized - parameterized roles
+MooseX::Role::Parameterized - roles with composition parameters
=head1 SYNOPSIS
@@ -181,16 +184,21 @@
$self->$name($self->$name + 1);
};
- method "decrement_$name" => sub {
+ method "reset_$name" => sub {
my $self = shift;
- $self->$name($self->$name - 1);
+ $self->$name(0);
};
};
- package MyGame::Tile;
+ package MyGame::Weapon;
use Moose;
- with 'MyRole::Counter' => { name => 'stepped_on' };
+ with 'MyRole::Counter' => { name => 'enchantment' };
+
+ package MyGame::Wand;
+ use Moose;
+
+ with 'MyRole::Counter' => { name => 'zapped' };
=head1 L<MooseX::Role::Parameterized::Tutorial>
@@ -204,10 +212,10 @@
Parameters are declared using the L</parameter> keyword which very much
resembles L<Moose/has>. You can use any option that L<Moose/has> accepts. The
-default value for the C<is> option is C<ro> as that's a very common case. These
-parameters will get their values when the consuming class (or role) uses
-L<Moose/with>. A parameter object will be constructed with these values, and
-passed to the C<role> block.
+default value for the C<is> option is C<ro> as that's a very common case. Use
+C<< is => 'bare' >> if you want no accessor. These parameters will get their
+values when the consuming class (or role) uses L<Moose/with>. A parameter
+object will be constructed with these values, and passed to the C<role> block.
The C<role> block then uses the usual L<Moose::Role> keywords to build up a
role. You can shift off the parameter object to inspect what the consuming
@@ -252,31 +260,41 @@
=over 4
+=item L<Fey::Role::HasAliasName>
+
+=item L<Fey::Role::MakesAliasObjects>
+
+=item L<Fey::Role::SQL::Cloneable>
+
+=item L<Fey::Role::SetOperation>
+
+=item L<IM::Engine::PluggableConstructor>
+
+=item L<IM::Engine::RequiresPlugins>
+
+=item L<KiokuDB::Role::Scan>
+
+=item L<MooseX::RelatedClassRoles>
+
=item L<MooseX::Role::Matcher>
=item L<MooseX::Role::XMLRPC::Client>
-=item L<MooseX::RelatedClassRoles>
+=item L<Net::Journyx::Object::Loadable>
+
+=item L<NetHack::Item::Role::IncorporatesStats>
+
+=item L<TAEB::Action::Role::Item>
=item L<WWW::Mechanize::TreeBuilder>
-=item L<NetHack::Item::Role::IncorporatesStats>
-
-=item L<TAEB::Action::Role::Item>
-
-=item L<KiokuDB::Role::Scan>
-
-=item L<Fey::Role::MakesAliasObjects>
-
-=item L<Fey::Role::HasAliasName>
-
-=item L<Fey::Role::SetOperation>
-
=back
=head1 SEE ALSO
L<http://sartak.blogspot.com/2009/05/parameterized-roles.html>
+
+L<http://stevan-little.blogspot.com/2009/07/thoughts-on-parameterized-roles.html>
=head1 COPYRIGHT AND LICENSE
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=42184&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 Thu Aug 20 18:13:40 2009
@@ -126,10 +126,10 @@
=head1 DESCRIPTION
-This is the metaclass for parameteriz-able roles, roles that have their
+This is the metaclass for parameterizable roles, roles that have their
parameters currently unbound. These are the roles that you use L<Moose/with>,
-but instead of composing the parameteriz-able role, we construct a new
-parameteriz-ed role
+but instead of composing the parameterizable role, we construct a new
+parameterized role
(L<MooseX::Role::Parameterized::Meta::Role::Parameterized>).
=cut
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=42184&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 Thu Aug 20 18:13:40 2009
@@ -24,9 +24,9 @@
=head1 DESCRIPTION
-This is the metaclass for parameteriz-ed roles; that is, parameteriz-able roles
+This is the metaclass for parameterized roles; that is, parameterizable roles
with their parameters bound. All this actually provides is a place to store the
-L<parameters> object.
+L<MooseX::Role::Parameterized::Parameters> object.
=cut
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=42184&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 Thu Aug 20 18:13:40 2009
@@ -19,12 +19,12 @@
This is the base class for parameter objects. Currently empty, but I reserve
the right to add things here.
-Each parameteriz-able role gets their own anonymous subclass of this;
+Each parameterizable role gets their own anonymous subclass of this;
L<MooseX::Role::Parameterized/parameter> actually operates on these anonymous
subclasses.
-Each parameteriz-ed role gets their own instance of the anonymous subclass
-(owned by the parameteriz-able role).
+Each parameterized role gets their own instance of the anonymous subclass
+(owned by the parameterizable role).
=cut
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=42184&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 Thu Aug 20 18:13:40 2009
@@ -91,7 +91,7 @@
can now also choose type, default value, whether it's required, B<traits>, etc.
parameter traits => (
- isa => 'ArrayRef[Str]',
+ isa => 'ArrayRef',
default => sub { [] },
);
Added: branches/upstream/libmoosex-role-parameterized-perl/current/t/017-current_metaclass.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-role-parameterized-perl/current/t/017-current_metaclass.t?rev=42184&op=file
==============================================================================
--- branches/upstream/libmoosex-role-parameterized-perl/current/t/017-current_metaclass.t (added)
+++ branches/upstream/libmoosex-role-parameterized-perl/current/t/017-current_metaclass.t Thu Aug 20 18:13:40 2009
@@ -1,0 +1,45 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 7;
+
+do {
+ package Labeled;
+ use MooseX::Role::Parameterized;
+
+ ::is(MooseX::Role::Parameterized->current_metaclass, undef, 'no metaclass yet');
+
+ parameter default => (
+ is => 'rw',
+ isa => 'Str',
+ );
+
+ ::is(MooseX::Role::Parameterized->current_metaclass, undef, 'no metaclass yet');
+
+ role {
+ my $p = shift;
+ my %args = @_;
+
+ ::is(MooseX::Role::Parameterized->current_metaclass, $args{operating_on}, 'now we have a metaclass');
+
+ has label => (
+ is => 'rw',
+ isa => 'Str',
+ default => $p->default,
+ );
+
+ ::is(MooseX::Role::Parameterized->current_metaclass, $args{operating_on}, 'now we have a metaclass');
+ };
+
+ ::is(MooseX::Role::Parameterized->current_metaclass, undef, 'no metaclass yet');
+};
+
+do {
+ package Foo;
+ use Moose;
+
+ ::is(MooseX::Role::Parameterized->current_metaclass, undef, 'no metaclass yet');
+ with Labeled => { default => 'foo' };
+ ::is(MooseX::Role::Parameterized->current_metaclass, undef, 'metaclass is gone now');
+};
+
More information about the Pkg-perl-cvs-commits
mailing list