From: Fuji, Goro Date: Thu, 23 Sep 2010 11:38:22 +0000 (+0900) Subject: Clean up X-Git-Tag: 0.71~25 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4cc4f8ed10b2e831b9917b94fdad6e4cdddf9997;p=gitmo%2FMouse.git Clean up --- diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 87fe84c..93fdf31 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -125,7 +125,7 @@ sub init_meta { my %args = @_; my $class = $args{for_class} - or confess("Cannot call init_meta without specifying a for_class"); + or confess("Cannot call init_meta without specifying a for_class"); my $base_class = $args{base_class} || 'Mouse::Object'; my $metaclass = $args{metaclass} || 'Mouse::Meta::Class'; diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index 2f3e98d..eb383e9 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -1,5 +1,5 @@ package Mouse::Meta::Role; -use Mouse::Util qw(:meta not_supported); # enables strict and warnings +use Mouse::Util qw(:meta); # enables strict and warnings use Mouse::Meta::Module; our @ISA = qw(Mouse::Meta::Module); @@ -200,10 +200,11 @@ sub apply { $args{_to} = 'instance'; $instance = $consumer; - $consumer = (Mouse::Util::class_of($instance) || 'Mouse::Meta::Class')->create_anon_class( - superclasses => [ref $instance], - cache => 1, - ); + $consumer = (Mouse::Util::class_of($instance) || 'Mouse::Meta::Class') + ->create_anon_class( + superclasses => [ref $instance], + cache => 1, + ); } if($args{alias} && !exists $args{-alias}){ diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index a4cb4c7..64d3b0d 100644 --- a/lib/Mouse/Role.pm +++ b/lib/Mouse/Role.pm @@ -30,9 +30,8 @@ sub extends { Carp::croak "Roles do not support 'extends'"; } -sub with { - my $meta = Mouse::Meta::Role->initialize(scalar caller); - Mouse::Util::apply_all_roles($meta->name, @_); +sub with { + Mouse::Util::apply_all_roles(scalar(caller), @_); return; }