Dirty fix; checks for ->isa('Devel::REPL') after apply().
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Meta / Plugin.pm
index c9cca5f..cd544c7 100644 (file)
@@ -6,6 +6,7 @@ extends 'Moose::Meta::Role';
 
 before 'apply' => sub {
   my ($self, $other) = @_;
+  return unless $other->isa('Devel::REPL');
   if (my $pre = $self->get_method('BEFORE_PLUGIN')) {
     $pre->body->($other, $self);
   }
@@ -13,6 +14,7 @@ before 'apply' => sub {
 
 after 'apply' => sub {
   my ($self, $other) = @_;
+  return unless $other->isa('Devel::REPL');
   if (my $pre = $self->get_method('AFTER_PLUGIN')) {
     $pre->body->($other, $self);
   }