X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FMeta%2FPlugin.pm;fp=lib%2FDevel%2FREPL%2FMeta%2FPlugin.pm;h=c9cca5fcb9b0f2eb79844a2d0d1b1993f5d77ab0;hp=0000000000000000000000000000000000000000;hb=4d33251a9f6d375aaafd8aa274743c68dec8f720;hpb=950232b2d6e2398c5f804c58e2bedf1e98fd7151 diff --git a/lib/Devel/REPL/Meta/Plugin.pm b/lib/Devel/REPL/Meta/Plugin.pm new file mode 100644 index 0000000..c9cca5f --- /dev/null +++ b/lib/Devel/REPL/Meta/Plugin.pm @@ -0,0 +1,21 @@ +package Devel::REPL::Meta::Plugin; + +use Moose; + +extends 'Moose::Meta::Role'; + +before 'apply' => sub { + my ($self, $other) = @_; + if (my $pre = $self->get_method('BEFORE_PLUGIN')) { + $pre->body->($other, $self); + } +}; + +after 'apply' => sub { + my ($self, $other) = @_; + if (my $pre = $self->get_method('AFTER_PLUGIN')) { + $pre->body->($other, $self); + } +}; + +1;