r65063 - in /branches/upstream/libmouse-perl/current: ./ inc/Module/Install/ lib/ lib/Mouse/ lib/Mouse/Meta/ lib/Mouse/Meta/Method/ lib/Mouse/Meta/Role/ lib/Mouse/Util/ t/001_mouse/ xs-src/
ansgar at users.alioth.debian.org
ansgar at users.alioth.debian.org
Sat Nov 20 11:05:31 UTC 2010
Author: ansgar
Date: Sat Nov 20 11:04:37 2010
New Revision: 65063
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65063
Log:
[svn-upgrade] new version libmouse-perl (0.87)
Removed:
branches/upstream/libmouse-perl/current/xshelper.h
Modified:
branches/upstream/libmouse-perl/current/Changes
branches/upstream/libmouse-perl/current/MANIFEST
branches/upstream/libmouse-perl/current/MANIFEST.SKIP
branches/upstream/libmouse-perl/current/META.yml
branches/upstream/libmouse-perl/current/Makefile.PL
branches/upstream/libmouse-perl/current/inc/Module/Install/TestTarget.pm
branches/upstream/libmouse-perl/current/lib/Mouse.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Exporter.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Attribute.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Class.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Accessor.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Constructor.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Delegation.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Destructor.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Module.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Application.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Composite.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Method.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Meta/TypeConstraint.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Object.pm
branches/upstream/libmouse-perl/current/lib/Mouse/PurePerl.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Role.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Spec.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Tiny.pod
branches/upstream/libmouse-perl/current/lib/Mouse/Util.pm
branches/upstream/libmouse-perl/current/lib/Mouse/Util/TypeConstraints.pm
branches/upstream/libmouse-perl/current/lib/Mouse/XS.pod
branches/upstream/libmouse-perl/current/t/001_mouse/043-parameterized-type.t
branches/upstream/libmouse-perl/current/xs-src/MouseTypeConstraints.xs
Modified: branches/upstream/libmouse-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/Changes?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/Changes (original)
+++ branches/upstream/libmouse-perl/current/Changes Sat Nov 20 11:04:37 2010
@@ -1,4 +1,15 @@
Revision history for Mouse
+
+0.87 2010-11-13 23:44:20
+ [BUG FIXES]
+ * Fix packaging issues
+ - META.yml was not updated (reported by @shohex)
+ - `make realclean` should remove xshelper.h
+ (patched by Ingy dot Net, and modified by gfx)
+
+ [OTHERS]
+ * Type coercion routines have been refactored; coercions are compiled
+ on demand.
0.86 2010-11-12 20:12:53
[BUG FIXES]
Modified: branches/upstream/libmouse-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/MANIFEST?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/MANIFEST (original)
+++ branches/upstream/libmouse-perl/current/MANIFEST Sat Nov 20 11:04:37 2010
@@ -372,7 +372,6 @@
xs-src/MouseAttribute.xs
xs-src/MouseTypeConstraints.xs
xs-src/MouseUtil.xs
-xshelper.h
xt/001-pod.t
xt/002-pod_spell.t
xt/003-pod_coverage.t
Modified: branches/upstream/libmouse-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/MANIFEST.SKIP?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/MANIFEST.SKIP (original)
+++ branches/upstream/libmouse-perl/current/MANIFEST.SKIP Sat Nov 20 11:04:37 2010
@@ -60,3 +60,5 @@
MYMETA\.yml$
Moose-t/
+xshelper\.h$
+
Modified: branches/upstream/libmouse-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/META.yml?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/META.yml (original)
+++ branches/upstream/libmouse-perl/current/META.yml Sat Nov 20 11:04:37 2010
@@ -31,4 +31,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: git://git.moose.perl.org/Mouse.git
-version: 0.84
+version: 0.87
Modified: branches/upstream/libmouse-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/Makefile.PL?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/Makefile.PL (original)
+++ branches/upstream/libmouse-perl/current/Makefile.PL Sat Nov 20 11:04:37 2010
@@ -99,6 +99,8 @@
author_tests 'xt';
repository 'git://git.moose.perl.org/Mouse.git';
+# or web interface:
+# http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Mouse.git;a=summary
system($^X, 'tool/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0
or warn "Cannot generate Mouse::Tiny: $!";
@@ -141,6 +143,7 @@
clean_files q{
lib/Mouse/Tiny.pm $(O_FILES) test-mydeps-*.log
+ xshelper.h
*.out
cover_db xs-src/*.gc{v,no,da}
};
Modified: branches/upstream/libmouse-perl/current/inc/Module/Install/TestTarget.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/inc/Module/Install/TestTarget.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/inc/Module/Install/TestTarget.pm (original)
+++ branches/upstream/libmouse-perl/current/inc/Module/Install/TestTarget.pm Sat Nov 20 11:04:37 2010
@@ -3,7 +3,7 @@
use 5.006_002;
use strict;
#use warnings; # XXX: warnings.pm produces a lot of 'redefine' warnings!
-our $VERSION = '0.13';
+our $VERSION = '0.14';
use base qw(Module::Install::Base);
use Config;
Modified: branches/upstream/libmouse-perl/current/lib/Mouse.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse.pm Sat Nov 20 11:04:37 2010
@@ -3,7 +3,7 @@
use Mouse::Exporter; # enables strict and warnings
-our $VERSION = '0.86';
+our $VERSION = '0.87';
use Carp qw(confess);
use Scalar::Util qw(blessed);
@@ -155,7 +155,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SYNOPSIS
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Exporter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Exporter.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Exporter.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Exporter.pm Sat Nov 20 11:04:37 2010
@@ -267,7 +267,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SYNOPSIS
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Attribute.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Attribute.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Attribute.pm Sat Nov 20 11:04:37 2010
@@ -342,7 +342,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Class.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Class.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Class.pm Sat Nov 20 11:04:37 2010
@@ -468,7 +468,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method.pm Sat Nov 20 11:04:37 2010
@@ -54,7 +54,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Accessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Accessor.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Accessor.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Accessor.pm Sat Nov 20 11:04:37 2010
@@ -187,7 +187,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Constructor.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Constructor.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Constructor.pm Sat Nov 20 11:04:37 2010
@@ -232,7 +232,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Delegation.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Delegation.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Delegation.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Delegation.pm Sat Nov 20 11:04:37 2010
@@ -61,7 +61,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Destructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Destructor.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Destructor.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Method/Destructor.pm Sat Nov 20 11:04:37 2010
@@ -65,7 +65,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Module.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Module.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Module.pm Sat Nov 20 11:04:37 2010
@@ -311,7 +311,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role.pm Sat Nov 20 11:04:37 2010
@@ -131,7 +131,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Application.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Application.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Application.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Application.pm Sat Nov 20 11:04:37 2010
@@ -209,7 +209,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Composite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Composite.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Composite.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Composite.pm Sat Nov 20 11:04:37 2010
@@ -156,7 +156,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Method.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Method.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/Role/Method.pm Sat Nov 20 11:04:37 2010
@@ -23,7 +23,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Meta/TypeConstraint.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Meta/TypeConstraint.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Meta/TypeConstraint.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Meta/TypeConstraint.pm Sat Nov 20 11:04:37 2010
@@ -67,9 +67,16 @@
$self->compile_type_constraint()
if !$args{hand_optimized_type_constraint};
- if($args{type_constraints}) {
- $self->_compile_union_type_coercion();
- }
+ if($args{type_constraints}) { # union types
+ foreach my $type(@{$self->{type_constraints}}){
+ if($type->has_coercion){
+ # set undef for has_coercion()
+ $self->{_compiled_type_coercion} = undef;
+ last;
+ }
+ }
+ }
+
return $self;
}
@@ -102,8 +109,8 @@
"Cannot add additional type coercions to Union types '$self'");
}
- my $coercions = ($self->{coercion_map} ||= []);
- my %has = map{ $_->[0] => undef } @{$coercions};
+ my $coercion_map = ($self->{coercion_map} ||= []);
+ my %has = map{ $_->[0]->name => undef } @{$coercion_map};
for(my $i = 0; $i < @_; $i++){
my $from = $_[ $i];
@@ -117,59 +124,65 @@
or $self->throw_error(
"Could not find the type constraint ($from) to coerce from");
- push @{$coercions}, [ $type => $action ];
- }
-
- $self->_compile_type_coercion();
+ push @{$coercion_map}, [ $type => $action ];
+ }
+
+ $self->{_compiled_type_coercion} = undef;
return;
}
-sub _compile_type_coercion {
+sub _compiled_type_coercion {
my($self) = @_;
- my @coercions = @{$self->{coercion_map}};
-
- $self->{_compiled_type_coercion} = sub {
- my($thing) = @_;
- foreach my $pair (@coercions) {
- #my ($constraint, $converter) = @$pair;
- if ($pair->[0]->check($thing)) {
- local $_ = $thing;
- return $pair->[1]->($thing);
+ my $coercion = $self->{_compiled_type_coercion};
+ return $coercion if defined $coercion;
+
+ if(!$self->{type_constraints}) {
+ my @coercions;
+ foreach my $pair(@{$self->{coercion_map}}) {
+ push @coercions,
+ [ $pair->[0]->_compiled_type_constraint, $pair->[1] ];
+ }
+
+ $coercion = sub {
+ my($thing) = @_;
+ foreach my $pair (@coercions) {
+ #my ($constraint, $converter) = @$pair;
+ if ($pair->[0]->($thing)) {
+ local $_ = $thing;
+ return $pair->[1]->($thing);
+ }
+ }
+ return $thing;
+ };
+ }
+ else { # for union type
+ my @coercions;
+ foreach my $type(@{$self->{type_constraints}}){
+ if($type->has_coercion){
+ push @coercions, $type;
}
- }
- return $thing;
- };
- return;
-}
-
-sub _compile_union_type_coercion {
- my($self) = @_;
-
- my @coercions;
- foreach my $type(@{$self->{type_constraints}}){
- if($type->has_coercion){
- push @coercions, $type;
- }
- }
- if(@coercions){
- $self->{_compiled_type_coercion} = sub {
- my($thing) = @_;
- foreach my $type(@coercions){
- my $value = $type->coerce($thing);
- return $value if $self->check($value);
- }
- return $thing;
- };
- }
- return;
+ }
+ if(@coercions){
+ $coercion = sub {
+ my($thing) = @_;
+ foreach my $type(@coercions){
+ my $value = $type->coerce($thing);
+ return $value if $self->check($value);
+ }
+ return $thing;
+ };
+ }
+ }
+
+ return( $self->{_compiled_type_coercion} = $coercion );
}
sub coerce {
my $self = shift;
return $_[0] if $self->check(@_);
- my $coercion = $self->{_compiled_type_coercion}
+ my $coercion = $self->_compiled_type_coercion
or $self->throw_error("Cannot coerce without a type coercion");
return $coercion->(@_);
}
@@ -248,8 +261,9 @@
sub _unite { # overload infix:<|>
my($lhs, $rhs) = @_;
require Mouse::Util::TypeConstraints;
- return Mouse::Util::TypeConstraints::find_or_parse_type_constraint(
- " $lhs | $rhs",
+ return Mouse::Util::TypeConstraints::_find_or_create_union_type(
+ $lhs,
+ Mouse::Util::TypeConstraints::find_or_create_isa_type_constraint($rhs),
);
}
@@ -262,7 +276,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Object.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Object.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Object.pm Sat Nov 20 11:04:37 2010
@@ -10,7 +10,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 METHODS
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/PurePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/PurePerl.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/PurePerl.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/PurePerl.pm Sat Nov 20 11:04:37 2010
@@ -613,7 +613,6 @@
sub type_parameter { $_[0]->{type_parameter} }
sub _compiled_type_constraint{ $_[0]->{compiled_type_constraint} }
-sub _compiled_type_coercion { $_[0]->{_compiled_type_coercion} }
sub __is_parameterized { exists $_[0]->{type_parameter} }
sub has_coercion { exists $_[0]->{_compiled_type_coercion} }
@@ -750,7 +749,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SEE ALSO
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Role.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Role.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Role.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Role.pm Sat Nov 20 11:04:37 2010
@@ -1,7 +1,7 @@
package Mouse::Role;
use Mouse::Exporter; # enables strict and warnings
-our $VERSION = '0.86';
+our $VERSION = '0.87';
use Carp qw(confess);
use Scalar::Util qw(blessed);
@@ -137,7 +137,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SYNOPSIS
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Spec.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Spec.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Spec.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Spec.pm Sat Nov 20 11:04:37 2010
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.86';
+our $VERSION = '0.87';
our $MouseVersion = $VERSION;
our $MooseVersion = '1.13';
@@ -19,7 +19,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SYNOPSIS
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Tiny.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Tiny.pod?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Tiny.pod (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Tiny.pod Sat Nov 20 11:04:37 2010
@@ -5,7 +5,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Util.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Util.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Util.pm Sat Nov 20 11:04:37 2010
@@ -48,7 +48,7 @@
},
);
- our $VERSION = '0.86';
+ our $VERSION = '0.87';
my $xs = !(defined(&is_valid_class_name) || $ENV{MOUSE_PUREPERL} || $ENV{PERL_ONLY});
@@ -388,7 +388,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 SYNOPSIS
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/Util/TypeConstraints.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/Util/TypeConstraints.pm?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/Util/TypeConstraints.pm (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/Util/TypeConstraints.pm Sat Nov 20 11:04:37 2010
@@ -290,8 +290,9 @@
}
sub _find_or_create_union_type{
- return if grep{ not defined } @_;
- my @types = sort map{ $_->{type_constraints} ? @{$_->{type_constraints}} : $_ } @_;
+ return if grep{ not defined } @_; # all things must be defined
+ my @types = sort
+ map{ $_->{type_constraints} ? @{$_->{type_constraints}} : $_ } @_;
my $name = join '|', @types;
@@ -431,7 +432,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head2 SYNOPSIS
Modified: branches/upstream/libmouse-perl/current/lib/Mouse/XS.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/lib/Mouse/XS.pod?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/lib/Mouse/XS.pod (original)
+++ branches/upstream/libmouse-perl/current/lib/Mouse/XS.pod Sat Nov 20 11:04:37 2010
@@ -5,7 +5,7 @@
=head1 VERSION
-This document describes Mouse version 0.86
+This document describes Mouse version 0.87
=head1 DESCRIPTION
Modified: branches/upstream/libmouse-perl/current/t/001_mouse/043-parameterized-type.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/t/001_mouse/043-parameterized-type.t?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/t/001_mouse/043-parameterized-type.t (original)
+++ branches/upstream/libmouse-perl/current/t/001_mouse/043-parameterized-type.t Sat Nov 20 11:04:37 2010
@@ -122,7 +122,8 @@
my $bar = Bar->new(list => [ qw(a b c) ]);
is_deeply( $bar->list, \@list, "list is as expected");
- } "coercion works";
+ } "coercion works"
+ or diag( Mouse::Util::TypeConstraints::find_type_constraint("Bar::List")->dump );
throws_ok {
Bar->new(list => [ { 1 => 2 }, 2, 3 ]);
Modified: branches/upstream/libmouse-perl/current/xs-src/MouseTypeConstraints.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmouse-perl/current/xs-src/MouseTypeConstraints.xs?rev=65063&op=diff
==============================================================================
--- branches/upstream/libmouse-perl/current/xs-src/MouseTypeConstraints.xs (original)
+++ branches/upstream/libmouse-perl/current/xs-src/MouseTypeConstraints.xs Sat Nov 20 11:04:37 2010
@@ -55,8 +55,10 @@
}
/*
- The following type check functions return an integer, not a bool, to keep them simple,
- so if you assign these return value to bool variable, you must use "expr ? TRUE : FALSE".
+ The following type check functions return an integer, not a bool, to keep
+ the code simple,
+ so if you assign these return value to a bool variable, you must use
+ "expr ? TRUE : FALSE".
*/
int
@@ -120,7 +122,7 @@
}
else {
char buf[64]; /* Must fit sprintf/Gconvert of longest NV */
- char* p;
+ const char* p;
(void)Gconvert(nv, NV_DIG, 0, buf);
p = &buf[0];
@@ -174,7 +176,7 @@
ENTER;
SAVETMPS;
- ok = is_an_instance_of("Mouse::Meta::Role", get_metaclass(sv));
+ ok = is_an_instance_of("Mouse::Meta::Role", get_metaclass(sv));
FREETMPS;
LEAVE;
@@ -276,7 +278,7 @@
static int
mouse_parameterized_HashRef(pTHX_ SV* const param, SV* const sv) {
- if(mouse_tc_HashRef(aTHX_ NULL, sv)){
+ if(IsHashRef(sv)){
HV* const hv = (HV*)SvRV(sv);
HE* he;
@@ -668,7 +670,6 @@
INSTALL_SIMPLE_READER(TypeConstraint, type_parameter);
INSTALL_SIMPLE_READER_WITH_KEY(TypeConstraint, _compiled_type_constraint, compiled_type_constraint);
- INSTALL_SIMPLE_READER(TypeConstraint, _compiled_type_coercion); /* Mouse specific */
INSTALL_SIMPLE_PREDICATE_WITH_KEY(TypeConstraint, has_coercion, _compiled_type_coercion);
INSTALL_SIMPLE_PREDICATE_WITH_KEY(TypeConstraint, __is_parameterized, type_parameter); /* Mouse specific */
@@ -735,7 +736,7 @@
for(parent = get_slots(self, "parent"); parent; parent = get_slots(parent, "parent")){
check = get_slots(parent, "hand_optimized_type_constraint");
if(check && SvOK(check)){
- if(!mouse_tc_CodeRef(aTHX_ NULL, check)){
+ if(!IsCodeRef(check)){
croak("Not a CODE reference");
}
av_unshift(checks, 1);
@@ -804,8 +805,9 @@
CODE:
{
SV* const check = get_slots(self, "compiled_type_constraint");
- if(!(check && mouse_tc_CodeRef(aTHX_ NULL, check))){
- mouse_throw_error(self, check, "'%"SVf"' has no compiled type constraint", self);
+ if(!(check && IsCodeRef(check))){
+ mouse_throw_error(self, check,
+ "'%"SVf"' has no compiled type constraint", self);
}
RETVAL = mouse_tc_check(aTHX_ check, sv) ? TRUE : FALSE;
}
More information about the Pkg-perl-cvs-commits
mailing list