From: Shawn M Moore Date: Sun, 28 Sep 2008 04:02:57 +0000 (+0000) Subject: Remove dep on CMM by just delay-loading X-Git-Tag: 0.19~207 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e31595cef06f35cd442a54206f3c1a05c1ac31f;p=gitmo%2FMouse.git Remove dep on CMM by just delay-loading --- diff --git a/Makefile.PL b/Makefile.PL index 705437e..13cf932 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,8 +3,6 @@ use inc::Module::Install; name 'Mouse'; all_from 'lib/Mouse.pm'; -requires 'Class::Method::Modifiers' => '1.01'; - build_requires 'Test::More'; build_requires 'Test::Exception'; diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 73264d1..661aad0 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -6,8 +6,6 @@ use warnings; use Mouse::Util qw/get_linear_isa blessed/; use Carp 'confess'; -use Class::Method::Modifiers (); - do { my %METACLASS_CACHE; @@ -132,6 +130,7 @@ sub attribute_metaclass { "Mouse::Meta::Class" } sub add_before_method_modifier { my ($self, $name, $code) = @_; + require Class::Method::Modifiers; Class::Method::Modifiers::_install_modifier( $self->name, 'before', @@ -142,6 +141,7 @@ sub add_before_method_modifier { sub add_around_method_modifier { my ($self, $name, $code) = @_; + require Class::Method::Modifiers; Class::Method::Modifiers::_install_modifier( $self->name, 'around', @@ -152,6 +152,7 @@ sub add_around_method_modifier { sub add_after_method_modifier { my ($self, $name, $code) = @_; + require Class::Method::Modifiers; Class::Method::Modifiers::_install_modifier( $self->name, 'after',