[Moose-commits] r7144 - in Mouse/trunk: . lib lib/Mouse/Meta
lib/Mouse/Meta/Method lib/Mouse/Util lib/MouseX
lib/MouseX/Types t t/800_shikabased
sartak at code2.0beta.co.uk
sartak at code2.0beta.co.uk
Mon Dec 22 02:30:56 GMT 2008
Author: sartak
Date: 2008-12-21 18:30:56 -0800 (Sun, 21 Dec 2008)
New Revision: 7144
Modified:
Mouse/trunk/
Mouse/trunk/Changes
Mouse/trunk/lib/Mouse.pm
Mouse/trunk/lib/Mouse/Meta/Attribute.pm
Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm
Mouse/trunk/lib/Mouse/Util/TypeConstraints.pm
Mouse/trunk/lib/MouseX/Types.pm
Mouse/trunk/lib/MouseX/Types/Mouse.pm
Mouse/trunk/t/501_moose_coerce_mouse.t
Mouse/trunk/t/800_shikabased/001-coerce.t
Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t
Mouse/trunk/t/800_shikabased/005-class_type.t
Mouse/trunk/t/800_shikabased/006-role_type.t
Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t
Mouse/trunk/t/800_shikabased/010-isa-or.t
Mouse/trunk/t/800_shikabased/014-subtype-as.t
Log:
r77734 at onn: sartak | 2008-12-21 21:30:29 -0500
Finish renaming Mouse::TypeRegistry to Mouse::Util::TypeConstraints
Property changes on: Mouse/trunk
___________________________________________________________________
Name: svk:merge
- 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77733
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
+ 08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse:77734
08e7d58d-de06-4458-8c15-335e402ab116:/local/Mouse-trunk:61565
3efe9002-19ed-0310-8735-a98156148065:/Mouse/branches/shika-based:6997
Modified: Mouse/trunk/Changes
===================================================================
--- Mouse/trunk/Changes 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/Changes 2008-12-22 02:30:56 UTC (rev 7144)
@@ -3,6 +3,8 @@
0.15
* Don't export Mouse's sugar into the package 'main'
+ * Rename Mouse::TypeRegistry to Mouse::Util::TypeConstraints
+
0.14 Sat Dec 20 16:53:05 2008
* POD fix
Modified: Mouse/trunk/lib/Mouse/Meta/Attribute.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Attribute.pm 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/lib/Mouse/Meta/Attribute.pm 2008-12-22 02:30:56 UTC (rev 7144)
@@ -83,7 +83,7 @@
if ($constraint) {
$accessor .= 'my $val = ';
if ($should_coerce) {
- $accessor .= 'Mouse::TypeRegistry->typecast_constraints("'.$attribute->associated_class->name.'", $attribute->{find_type_constraint}, $attribute->{type_constraint}, '.$value.');';
+ $accessor .= 'Mouse::Util::TypeConstraints->typecast_constraints("'.$attribute->associated_class->name.'", $attribute->{find_type_constraint}, $attribute->{type_constraint}, '.$value.');';
} else {
$accessor .= $value.';';
}
@@ -210,7 +210,7 @@
my @type_constraints = split /\|/, $type_constraint;
my $code;
- my $optimized_constraints = Mouse::TypeRegistry->optimized_constraints;
+ my $optimized_constraints = Mouse::Util::TypeConstraints->optimized_constraints;
if (@type_constraints == 1) {
$code = $optimized_constraints->{$type_constraints[0]} ||
sub { Scalar::Util::blessed($_) && $_->isa($type_constraints[0]) };
@@ -343,7 +343,7 @@
sub coerce_constraint { ## my($self, $value) = @_;
my $type = $_[0]->{type_constraint}
or return $_[1];
- return Mouse::TypeRegistry->typecast_constraints($_[0]->associated_class->name, $_[0]->find_type_constraint, $type, $_[1]);
+ return Mouse::Util::TypeConstraints->typecast_constraints($_[0]->associated_class->name, $_[0]->find_type_constraint, $type, $_[1]);
}
sub _canonicalize_handles {
Modified: Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/lib/Mouse/Meta/Method/Constructor.pm 2008-12-22 02:30:56 UTC (rev 7144)
@@ -42,7 +42,7 @@
$code .= "if (exists \$args->{'$from'}) {\n";
if ($attr->should_coerce && $attr->type_constraint) {
- $code .= "my \$value = Mouse::TypeRegistry->typecast_constraints('".$attr->associated_class->name."', \$attrs[$index]->{find_type_constraint}, \$attrs[$index]->{type_constraint}, \$args->{'$from'});\n";
+ $code .= "my \$value = Mouse::Util::TypeConstraints->typecast_constraints('".$attr->associated_class->name."', \$attrs[$index]->{find_type_constraint}, \$attrs[$index]->{type_constraint}, \$args->{'$from'});\n";
}
else {
$code .= "my \$value = \$args->{'$from'};\n";
@@ -78,7 +78,7 @@
$code .= "my \$value = ";
if ($attr->should_coerce && $attr->type_constraint) {
- $code .= "Mouse::TypeRegistry->typecast_constraints('".$attr->associated_class->name."', \$attrs[$index]->{find_type_constraint}, \$attrs[$index]->{type_constraint}, ";
+ $code .= "Mouse::Util::TypeConstraints->typecast_constraints('".$attr->associated_class->name."', \$attrs[$index]->{find_type_constraint}, \$attrs[$index]->{type_constraint}, ";
}
if ($attr->has_builder) {
Modified: Mouse/trunk/lib/Mouse/Util/TypeConstraints.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Util/TypeConstraints.pm 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/lib/Mouse/Util/TypeConstraints.pm 2008-12-22 02:30:56 UTC (rev 7144)
@@ -1,4 +1,4 @@
-package Mouse::TypeRegistry;
+package Mouse::Util::TypeConstraints;
use strict;
use warnings;
@@ -166,7 +166,7 @@
=head1 NAME
-Mouse::TypeRegistry - simple type constraints
+Mouse::Util::TypeConstraints - simple type constraints
=head1 METHODS
Modified: Mouse/trunk/lib/Mouse.pm
===================================================================
--- Mouse/trunk/lib/Mouse.pm 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/lib/Mouse.pm 2008-12-22 02:30:56 UTC (rev 7144)
@@ -21,7 +21,7 @@
use Mouse::Meta::Attribute;
use Mouse::Meta::Class;
use Mouse::Object;
-use Mouse::TypeRegistry;
+use Mouse::Util::TypeConstraints;
our @EXPORT = qw(extends has before after around blessed confess with);
Modified: Mouse/trunk/lib/MouseX/Types/Mouse.pm
===================================================================
--- Mouse/trunk/lib/MouseX/Types/Mouse.pm 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/lib/MouseX/Types/Mouse.pm 2008-12-22 02:30:56 UTC (rev 7144)
@@ -2,11 +2,11 @@
use strict;
use warnings;
-BEGIN { require Mouse::TypeRegistry }
+BEGIN { require Mouse::Util::TypeConstraints }
use MouseX::Types;
BEGIN {
- my $builtin_type = +{ map { $_ => $_ } Mouse::TypeRegistry->list_all_builtin_type_constraints };
+ my $builtin_type = +{ map { $_ => $_ } Mouse::Util::TypeConstraints->list_all_builtin_type_constraints };
sub type_storage { $builtin_type }
}
Modified: Mouse/trunk/lib/MouseX/Types.pm
===================================================================
--- Mouse/trunk/lib/MouseX/Types.pm 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/lib/MouseX/Types.pm 2008-12-22 02:30:56 UTC (rev 7144)
@@ -2,7 +2,7 @@
use strict;
use warnings;
-require Mouse::TypeRegistry;
+require Mouse::Util::TypeConstraints;
use MouseX::Types::TypeDecorator;
sub import {
@@ -22,7 +22,7 @@
}
}
- return Mouse::TypeRegistry->import( callee => $caller );
+ return Mouse::Util::TypeConstraints->import( callee => $caller );
}
sub _import {
Modified: Mouse/trunk/t/501_moose_coerce_mouse.t
===================================================================
--- Mouse/trunk/t/501_moose_coerce_mouse.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/501_moose_coerce_mouse.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -20,7 +20,7 @@
{
package Response;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'HeadersType' => where { defined $_ && eval { $_->isa('Headers') } };
coerce 'HeadersType' =>
Modified: Mouse/trunk/t/800_shikabased/001-coerce.t
===================================================================
--- Mouse/trunk/t/800_shikabased/001-coerce.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/800_shikabased/001-coerce.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -11,7 +11,7 @@
{
package Response;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'HeadersType' => as 'Object' => where { defined $_ && eval { $_->isa('Headers') } };
coerce 'HeadersType' =>
Modified: Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t
===================================================================
--- Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/800_shikabased/002-coerce_multi_class.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -16,7 +16,7 @@
{
package Response;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'Headers' => where { defined $_ && eval { $_->isa('Response::Headers') } };
coerce 'Headers' =>
@@ -34,7 +34,7 @@
eval {
package Request;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'Headers' => where { defined $_ && eval { $_->isa('Request::Headers') } };
};
@@ -42,7 +42,7 @@
eval {
package Request;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
coerce 'TooBad' =>
from 'HashRef' => via {
@@ -54,7 +54,7 @@
eval {
package Request;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
coerce 'Headers' =>
from 'HashRef' => via {
@@ -66,7 +66,7 @@
eval {
package Request;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
coerce 'Headers' =>
from 'HashRefa' => via {
@@ -78,7 +78,7 @@
eval {
package Request;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
coerce 'Headers' =>
from 'ArrayRef' => via {
Modified: Mouse/trunk/t/800_shikabased/005-class_type.t
===================================================================
--- Mouse/trunk/t/800_shikabased/005-class_type.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/800_shikabased/005-class_type.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -4,7 +4,7 @@
{
package Response;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
class_type Headers => { class => 't::lib::ClassType_Foo' };
coerce 'Headers' =>
Modified: Mouse/trunk/t/800_shikabased/006-role_type.t
===================================================================
--- Mouse/trunk/t/800_shikabased/006-role_type.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/800_shikabased/006-role_type.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -29,7 +29,7 @@
{
package Response;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
role_type Headers => { role => 'Response::Headers::Role' };
coerce 'Headers' =>
Modified: Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t
===================================================================
--- Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/800_shikabased/009-overwrite-builtin-subtype.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -4,7 +4,7 @@
eval {
package Request;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'Int' => where { 1};
};
Modified: Mouse/trunk/t/800_shikabased/010-isa-or.t
===================================================================
--- Mouse/trunk/t/800_shikabased/010-isa-or.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/800_shikabased/010-isa-or.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -5,7 +5,7 @@
{
package Foo;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype Baz => where { defined($_) && $_ eq 'Baz' };
coerce Baz => from 'ArrayRef', via { 'Baz' };
has 'bar' => ( is => 'rw', isa => 'Str | Baz | Undef', coerce => 1 );
@@ -51,7 +51,7 @@
{
package Bar;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'Type1' => where { defined($_) && $_ eq 'Name' };
coerce 'Type1', from 'Str', via { 'Names' };
@@ -74,7 +74,7 @@
{
package Baz;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'Type3' => where { defined($_) && $_ eq 'Name' };
coerce 'Type3', from 'CodeRef', via { 'Name' };
Modified: Mouse/trunk/t/800_shikabased/014-subtype-as.t
===================================================================
--- Mouse/trunk/t/800_shikabased/014-subtype-as.t 2008-12-22 02:30:36 UTC (rev 7143)
+++ Mouse/trunk/t/800_shikabased/014-subtype-as.t 2008-12-22 02:30:56 UTC (rev 7144)
@@ -16,7 +16,7 @@
{
package Foo;
use Mouse;
- use Mouse::TypeRegistry;
+ use Mouse::Util::TypeConstraints;
subtype 'Type1' => as 'Str' => where { blessed($_) };
has str_obj => (
More information about the Moose-commits
mailing list