X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse.pm;h=939d84586d146aa9af2a31931e65ad7db4570379;hb=e7dff5dc48e3945ca311b03ac02c6734a0f9cfa6;hp=22d8b2dceeb0e276227e34ed3adbf35e707bc59d;hpb=1bfebf5f59ec3d3b5624f3d3a186506150f08ed2;p=gitmo%2FMouse.git diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 22d8b2d..939d845 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -3,7 +3,7 @@ package Mouse; use strict; use warnings; -our $VERSION = '0.04'; +our $VERSION = '0.05'; use 5.006; use Sub::Exporter; @@ -68,6 +68,20 @@ do { around => sub { return \&Class::Method::Modifiers::around; }, + + with => sub { + my $caller = $CALLER; + + return sub { + my $role = shift; + my $class = $caller->meta; + + confess "Mouse::Role only supports 'with' on individual roles at a time"; + + Mouse::load_class($role); + $role->meta->apply_to_class($class); + }; + }, ); my $exporter = Sub::Exporter::build_exporter({