X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FModule.pm;h=540d3292beda2c16809bb76cfda2b80b6f33d25b;hb=fd2b172a4657cb6cc47976d2e66cdba4bdfa579d;hp=546bb2e21f726d2040a2844810bc2ea7591fd3ef;hpb=cf267e676ef8c258c71348c3becd5da2d7f9f36c;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index 546bb2e..540d329 100644 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -14,12 +14,6 @@ if(Mouse::Util::MOUSE_XS){ *CLONE = sub { Mouse::Util::__register_metaclass_storage(\%METAS, 1) }; } -sub _metaclass_cache { # DEPRECATED - my($self, $name) = @_; - Carp::cluck('_metaclass_cache() has been deprecated. Use Mouse::Util::get_metaclass_by_name() instead'); - return $METAS{$name}; -} - sub initialize { my($class, $package_name, @args) = @_; @@ -52,7 +46,8 @@ sub _class_of{ } # Means of accessing all the metaclasses that have -# been initialized thus far +# been initialized thus far. +# The public versions are aliased into Mouse::Util::*. #sub _get_all_metaclasses { %METAS } sub _get_all_metaclass_instances { values %METAS } sub _get_all_metaclass_names { keys %METAS } @@ -79,7 +74,7 @@ sub remove_attribute { delete $_[0]->{attributes}->{$_[1]} } sub get_attribute_list{ keys %{$_[0]->{attributes}} } -# XXX: for backward compatibility +# XXX: not completely compatible with Moose my %foreign = map{ $_ => undef } qw( Mouse Mouse::Role Mouse::Util Mouse::Util::TypeConstraints Carp Scalar::Util List::Util @@ -133,7 +128,7 @@ sub get_method_list { return grep { $self->has_method($_) } keys %{ $self->namespace }; } -sub _collect_methods { # Mouse specific +sub _collect_methods { # Mouse specific, used for method modifiers my($meta, @args) = @_; my @methods; @@ -219,6 +214,7 @@ sub create { $package_name = $class . '::__ANON__::' . $ANON_SERIAL; } + # instantiate a module { no strict 'refs'; @@ -262,7 +258,7 @@ sub create { $meta->add_method($method_name, $method_body); } } - if (defined $roles){ + if (defined $roles and !$options{in_application_to_instance}){ Mouse::Util::apply_all_roles($package_name, @{$roles}); } @@ -315,7 +311,7 @@ Mouse::Meta::Module - The common base class of Mouse::Meta::Class and Mouse::Met =head1 VERSION -This document describes Mouse version 0.76 +This document describes Mouse version 0.87 =head1 DESCRIPTION