Hello community, here is the log from the commit of package perl-MooseX-Role-Parameterized for openSUSE:Factory checked in at 2012-03-01 17:25:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-MooseX-Role-Parameterized (Old) and /work/SRC/openSUSE:Factory/.perl-MooseX-Role-Parameterized.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "perl-MooseX-Role-Parameterized", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-MooseX-Role-Parameterized/perl-MooseX-Role-Parameterized.changes 2011-12-21 10:02:31.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-MooseX-Role-Parameterized.new/perl-MooseX-Role-Parameterized.changes 2012-03-01 17:25:11.000000000 +0100 @@ -1,0 +2,19 @@ +Mon Feb 27 10:09:25 UTC 2012 - coolo@suse.com + +- updated to 1.00 + * MooseX::Role::Parameterized now depends on Moose 2.0300 + released 2011-09-23 for its several core improvements, hence the + major version number bump. + * MXRP now uses the new meta_lookup feature added to Moose 2.0300 + (specifically for MXRP) to avoid duplicating Moose-0.60-era + Moose::Role sugar. This means the error messages you get are + better, and there's a lot less ugly code in MXRP. + * Remove alias/excludes special case errors. They have long since been + replaced in core Moose by -alias and -excludes, and were finally + removed in Moose 2.0200. + * Expressly forbid using role { } inside role { } (which makes no + sense but I suppose you could accidentally trigger it) + * Documentation fix from cweyl@alumni.drew.edu + https://github.com/sartak/MooseX-Role-Parameterized/pull/5 + +------------------------------------------------------------------- Old: ---- MooseX-Role-Parameterized-0.27.tar.gz New: ---- MooseX-Role-Parameterized-1.00.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-MooseX-Role-Parameterized.spec ++++++ --- /var/tmp/diff_new_pack.0QHeDY/_old 2012-03-01 17:25:12.000000000 +0100 +++ /var/tmp/diff_new_pack.0QHeDY/_new 2012-03-01 17:25:12.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-MooseX-Role-Parameterized # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,11 +17,11 @@ Name: perl-MooseX-Role-Parameterized -Version: 0.27 +Version: 1.00 Release: 0 %define cpan_name MooseX-Role-Parameterized Summary: Roles with composition parameters -License: GPL-1.0+ or Artistic-1.0 +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/MooseX-Role-Parameterized/ Source: http://www.cpan.org/authors/id/S/SA/SARTAK/%{cpan_name}-%{version}.tar.gz @@ -30,11 +30,47 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(Moose) >= 0.78 +BuildRequires: perl(Moose) >= 2.0300 BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::Moose) BuildRequires: perl(Test::More) >= 0.96 -Requires: perl(Moose) >= 0.78 +#BuildRequires: perl(Bar) +#BuildRequires: perl(Foo) +#BuildRequires: perl(Foo::Role) +#BuildRequires: perl(inc::Module::Install) +#BuildRequires: perl(JSON) +#BuildRequires: perl(LWP::Simple) +#BuildRequires: perl(Module::Build) +#BuildRequires: perl(Module::Install::AutoManifest) +#BuildRequires: perl(Module::Install::Base) +#BuildRequires: perl(Module::Install::GithubMeta) +#BuildRequires: perl(Module::Install::ManifestSkip) +#BuildRequires: perl(Moose::Exporter) +#BuildRequires: perl(Moose::Meta::Role) +#BuildRequires: perl(Moose::Role) +#BuildRequires: perl(Moose::Util::TypeConstraints) +#BuildRequires: perl(MooseX::Role::Parameterized) +#BuildRequires: perl(MooseX::Role::Parameterized::Meta::Role::Parameterizable) +#BuildRequires: perl(MooseX::Role::Parameterized::Meta::Role::Parameterized) +#BuildRequires: perl(MooseX::Role::Parameterized::Meta::Trait::Parameterized) +#BuildRequires: perl(MooseX::Role::Parameterized::Parameters) +#BuildRequires: perl(MyCompositeRoleA) +#BuildRequires: perl(MyItem::Role::Equippable) +#BuildRequires: perl(MyItem::Role::Wearable) +#BuildRequires: perl(MyPRole) +#BuildRequires: perl(MyRole) +#BuildRequires: perl(MyRole::Delegator) +#BuildRequires: perl(MyRole::LogMethod) +#BuildRequires: perl(MyRole::Parameterized) +#BuildRequires: perl(MyRole::Sans::Block) +#BuildRequires: perl(MyRole::Storage) +#BuildRequires: perl(MyTrait) +#BuildRequires: perl(OtherRole) +#BuildRequires: perl(Parse::CPAN::Meta) +#BuildRequires: perl(P::Role) +#BuildRequires: perl(Test::Consumer) +#BuildRequires: perl(YAML::Tiny) +Requires: perl(Moose) >= 2.0300 %{perl_requires} %description @@ -81,9 +117,6 @@ %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} - %files -f %{name}.files %defattr(-,root,root,755) %doc Changes ++++++ MooseX-Role-Parameterized-0.27.tar.gz -> MooseX-Role-Parameterized-1.00.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/Changes new/MooseX-Role-Parameterized-1.00/Changes --- old/MooseX-Role-Parameterized-0.27/Changes 2011-08-22 20:58:49.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/Changes 2012-01-12 18:46:02.000000000 +0100 @@ -1,5 +1,22 @@ Changes for MooseX-Role-Parameterized +1.00 January 12, 2012 + * MooseX::Role::Parameterized now depends on Moose 2.0300 + released 2011-09-23 for its several core improvements, hence the + major version number bump. + + * MXRP now uses the new meta_lookup feature added to Moose 2.0300 + (specifically for MXRP) to avoid duplicating Moose-0.60-era + Moose::Role sugar. This means the error messages you get are + better, and there's a lot less ugly code in MXRP. + * Remove alias/excludes special case errors. They have long since been + replaced in core Moose by -alias and -excludes, and were finally + removed in Moose 2.0200. + * Expressly forbid using role { } inside role { } (which makes no + sense but I suppose you could accidentally trigger it) + * Documentation fix from cweyl@alumni.drew.edu + https://github.com/sartak/MooseX-Role-Parameterized/pull/5 + 0.27 August 22, 2011 * Remove MooseX::Role::Parameterized::Meta::Parameter; instead, the default for parameters of (is => 'ro') is set by the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/META.yml new/MooseX-Role-Parameterized-1.00/META.yml --- old/MooseX-Role-Parameterized-0.27/META.yml 2011-08-22 20:58:54.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/META.yml 2012-01-12 18:45:11.000000000 +0100 @@ -21,7 +21,7 @@ - inc - t requires: - Moose: 0.78 + Moose: 2.0300 perl: 5.8.1 resources: homepage: http://github.com/sartak/MooseX-Role-Parameterized/tree @@ -30,4 +30,4 @@ type: git url: git://github.com/sartak/MooseX-Role-Parameterized.git web: http://github.com/sartak/MooseX-Role-Parameterized/tree -version: 0.27 +version: 1.00 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/Makefile.PL new/MooseX-Role-Parameterized-1.00/Makefile.PL --- old/MooseX-Role-Parameterized-0.27/Makefile.PL 2011-08-22 20:58:49.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/Makefile.PL 2011-09-26 20:54:02.000000000 +0200 @@ -9,7 +9,7 @@ all_from 'lib/MooseX/Role/Parameterized.pm'; githubmeta; -requires 'Moose' => '0.78'; +requires 'Moose' => '2.0300'; test_requires 'Test::Moose'; test_requires 'Test::More' => '0.96'; test_requires 'Test::Fatal'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm new/MooseX-Role-Parameterized-1.00/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm --- old/MooseX-Role-Parameterized-0.27/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm 2011-08-22 20:58:49.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm 2012-01-12 18:38:14.000000000 +0100 @@ -7,7 +7,11 @@ use MooseX::Role::Parameterized::Meta::Role::Parameterized; use MooseX::Role::Parameterized::Parameters; -use constant parameterized_role_metaclass => 'MooseX::Role::Parameterized::Meta::Role::Parameterized'; +has parameterized_role_metaclass => ( + is => 'ro', + isa => 'ClassName', + default => 'MooseX::Role::Parameterized::Meta::Role::Parameterized', +); has parameters_class => ( is => 'ro', @@ -19,15 +23,11 @@ is => 'rw', isa => 'Moose::Meta::Class', lazy => 1, - default => sub { - my $self = shift; - - $self->parameters_class->meta->create_anon_class( - superclasses => [$self->parameters_class], - ); - }, + builder => '_build_parameters_metaclass', handles => { - has_parameter => 'has_attribute', + has_parameter => 'has_attribute', + add_parameter => 'add_attribute', + construct_parameters => 'new_object', }, ); @@ -37,30 +37,12 @@ predicate => 'has_role_generator', ); -sub add_parameter { +sub _build_parameters_metaclass { my $self = shift; - my $name = shift; - - confess "You must provide a name for the parameter" - if !defined($name); - confess "The parameter name ($name) is currently forbidden" - if $name eq 'alias' - || $name eq 'excludes'; - - $self->parameters_metaclass->add_attribute($name => @_); -} - -sub construct_parameters { - my $self = shift; - my %args = @_; - - for my $name ('alias', 'excludes') { - confess "The parameter name ($name) is currently forbidden" - if exists $args{$name}; - } - - $self->parameters_metaclass->new_object(%args); + return $self->parameters_class->meta->create_anon_class( + superclasses => [$self->parameters_class], + ); } sub generate_role { @@ -146,14 +128,19 @@ =head1 DESCRIPTION -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 parameterizable role, we construct a new -parameterized role -(LMooseX::Role::Parameterized::Meta::Role::Parameterized). +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 parameterizable +role, we construct a new parameterized role +(LMooseX::Role::Parameterized::Meta::Role::Parameterized) and use +that new parameterized instead. =head1 ATTRIBUTES +=head2 parameterized_role_metaclass + +The name of the class that will be used to construct the parameterized role. + =head2 parameters_class The name of the class that will be used to construct the parameters object. @@ -177,9 +164,8 @@ =head2 add_parameter $name, %options -Basically delegates to LMoose::Meta::Class/add_attribute on the -L</parameters_metaclass> but with error messages that refer to a "parameter" -not an "attribute". +Delegates to LMoose::Meta::Class/add_attribute on the +L</parameters_metaclass> object. =head2 construct_parameters %arguments @@ -190,11 +176,27 @@ =head2 generate_role %arguments -Returns a new instance of -LMooseX::Role::Parameterized::Meta::Role::Parameterized based on the -arguments. The arguments are a hash reference of C<parameters> and, if -available, a C<consumer> metaobject. A C<package> argument may be given to use -a specific package name instead of autogenerating one. +This method generates and returns a new instance of +L</parameterized_role_metaclass>. It can take any combination of +three named parameters: + +=over 4 + +=item arguments + +A hashref of parameters for the role, same as would be passed in at a "with" +statement. + +=item package + +A package name that, if present, we will use for the generated role; if not, +we generate an anonymous role. + +=item consumer + +A consumer metaobject, if available. + +=back =head2 apply diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/lib/MooseX/Role/Parameterized/Tutorial.pod new/MooseX-Role-Parameterized-1.00/lib/MooseX/Role/Parameterized/Tutorial.pod --- old/MooseX-Role-Parameterized-0.27/lib/MooseX/Role/Parameterized/Tutorial.pod 2011-04-22 22:28:58.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/lib/MooseX/Role/Parameterized/Tutorial.pod 2011-08-29 18:20:30.000000000 +0200 @@ -29,10 +29,11 @@ =head3 C<with> -The syntax of a class consuming a parameterized role has not changed from the -standard C<with>. You pass in parameters just like you pass in C<-alias> and -C<-excludes> to ordinary roles (though without hyphens, since these are not -core Moose composition parameters): +The syntax of a class consuming a parameterized role has not changed +from the standard C<with>. You pass in parameters just like you +pass in C<-alias> and C<-excludes> to ordinary roles (though your +custom parameters do not get hyphens, since these are not core Moose +composition parameters): with 'MyRole::InstrumentMethod' => { method_name => 'dbh_do', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/lib/MooseX/Role/Parameterized.pm new/MooseX-Role-Parameterized-1.00/lib/MooseX/Role/Parameterized.pm --- old/MooseX-Role-Parameterized-0.27/lib/MooseX/Role/Parameterized.pm 2011-08-22 20:58:49.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/lib/MooseX/Role/Parameterized.pm 2012-01-12 18:44:03.000000000 +0100 @@ -3,29 +3,28 @@ use Moose::Role (); use Moose::Exporter; use Carp 'confess'; -use Scalar::Util 'blessed'; use MooseX::Role::Parameterized::Meta::Role::Parameterizable; -our $VERSION = '0.27'; +our $VERSION = '1.00'; our $CURRENT_METACLASS; +sub current_metaclass { $CURRENT_METACLASS } + Moose::Exporter->setup_import_methods( - with_caller => ['parameter', 'role', 'method', 'has', 'with', 'extends', - 'requires', 'excludes', 'augment', 'inner', 'before', - 'after', 'around', 'super', 'override'], - as_is => [ 'confess', 'blessed' ], + also => 'Moose::Role', + with_caller => ['parameter', 'role'], + with_meta => ['method'], + meta_lookup => sub { current_metaclass || Class::MOP::class_of(shift) }, ); -sub current_metaclass { $CURRENT_METACLASS } - sub parameter { my $caller = shift; confess "'parameter' may not be used inside of the role block" - if $CURRENT_METACLASS && $CURRENT_METACLASS->genitor->name eq $caller; + if current_metaclass && current_metaclass->genitor->name eq $caller; - my $meta = Class::MOP::class_of($caller); + my $meta = Class::MOP::class_of($caller); my $names = shift; $names = [$names] if !ref($names); @@ -41,6 +40,10 @@ sub role (&) { my $caller = shift; my $role_generator = shift; + + confess "'role' may not be used inside of the role block" + if current_metaclass && current_metaclass->genitor->name eq $caller; + Class::MOP::class_of($caller)->role_generator($role_generator); } @@ -52,27 +55,13 @@ return Moose::Role->init_meta(%options); } -sub has { - my $caller = shift; - my $meta = $CURRENT_METACLASS || Class::MOP::class_of($caller); - - my $names = shift; - $names = [$names] if !ref($names); - - for my $name (@$names) { - $meta->add_attribute($name, @_); - } -} - sub method { - my $caller = shift; - my $meta = $CURRENT_METACLASS || Class::MOP::class_of($caller); - - my $name = shift; - my $body = shift; + my $meta = shift; + my $name = shift; + my $body = shift; my $method = $meta->method_metaclass->wrap( - package_name => $caller, + package_name => $meta->name, name => $name, body => $body, ); @@ -80,79 +69,6 @@ $meta->add_method($name => $method); } -sub _add_method_modifier { - my $type = shift; - my $caller = shift; - my $meta = $CURRENT_METACLASS || Class::MOP::class_of($caller); - - my $code = pop @_; - - for (@_) { - Carp::croak "Roles do not currently support " - . ref($_) - . " references for $type method modifiers" - if ref $_; - - my $add_method = "add_${type}_method_modifier"; - $meta->$add_method($_, $code); - } -} - -sub before { - _add_method_modifier('before', @_); -} - -sub after { - _add_method_modifier('after', @_); -} - -sub around { - _add_method_modifier('around', @_); -} - -sub with { - my $caller = shift; - my $meta = $CURRENT_METACLASS || Class::MOP::class_of($caller); - - Moose::Util::apply_all_roles($meta, @_); -} - -sub requires { - my $caller = shift; - my $meta = $CURRENT_METACLASS || Class::MOP::class_of($caller); - - Carp::croak "Must specify at least one method" unless @_; - $meta->add_required_methods(@_); -} - -sub excludes { - my $caller = shift; - my $meta = $CURRENT_METACLASS || Class::MOP::class_of($caller); - - Carp::croak "Must specify at least one role" unless @_; - $meta->add_excluded_roles(@_); -} - -# see Moose.pm for discussion -sub super { - return unless $Moose::SUPER_BODY; - $Moose::SUPER_BODY->(@Moose::SUPER_ARGS); -} - -sub override { - my $caller = shift; - my $meta = $CURRENT_METACLASS || Class::MOP::class_of($caller); - - my ($name, $code) = @_; - $meta->add_override_method_modifier($name, $code); -} - -sub extends { Carp::croak "Roles do not currently support 'extends'" } - -sub inner { Carp::croak "Roles cannot support 'inner'" } - -sub augment { Carp::croak "Roles cannot support 'augment'" } - 1; __END__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/t/100-erroneous-keywords.t new/MooseX-Role-Parameterized-1.00/t/100-erroneous-keywords.t --- old/MooseX-Role-Parameterized-0.27/t/100-erroneous-keywords.t 2011-08-22 20:52:36.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/t/100-erroneous-keywords.t 2011-08-29 18:23:15.000000000 +0200 @@ -10,12 +10,12 @@ ::like( ::exception { parameter() - }, qr/^You must provide a name for the parameter/); + }, qr/^You must provide a name for the attribute/); role { ::like( ::exception { extends 'MyRole::Parameterized'; - }, qr/^Roles do not currently support 'extends'/); + }, qr/^Roles do not support 'extends' (you can use 'with' to specialize a role)/); ::like( ::exception { inner() }, qr/^Roles cannot support 'inner'/); @@ -25,6 +25,9 @@ ::like( ::exception { parameter() }, qr/^'parameter' may not be used inside of the role block/); + ::like( ::exception { + role {} + }, qr/^'role' may not be used inside of the role block/); }; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MooseX-Role-Parameterized-0.27/t/101-alias-excludes.t new/MooseX-Role-Parameterized-1.00/t/101-alias-excludes.t --- old/MooseX-Role-Parameterized-0.27/t/101-alias-excludes.t 2011-04-22 22:54:24.000000000 +0200 +++ new/MooseX-Role-Parameterized-1.00/t/101-alias-excludes.t 2011-08-29 18:22:12.000000000 +0200 @@ -8,30 +8,32 @@ package MyRole; use MooseX::Role::Parameterized; - ::like( ::exception { + ::is( ::exception { parameter 'alias'; - }, qr/^The parameter name (alias) is currently forbidden/); + }, undef); - ::like( ::exception { + ::is( ::exception { parameter 'excludes'; - }, qr/^The parameter name (excludes) is currently forbidden/); + }, undef); + + role { } }; do { package MyClass; use Moose; - ::like( ::exception { + ::is( ::exception { with MyRole => { alias => 1, }; - }, qr/^The parameter name (alias) is currently forbidden/); + }, undef); - ::like( ::exception { + ::is( ::exception { with MyRole => { excludes => 1, }; - }, qr/^The parameter name (excludes) is currently forbidden/); + }, undef); }; do { -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org