add use strict; use warnings to modules, just to be sure
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Meta / Plugin.pm
index c9cca5f..03f19f1 100644 (file)
@@ -1,3 +1,5 @@
+use strict;
+use warnings;
 package Devel::REPL::Meta::Plugin;
 
 use Moose;
@@ -6,6 +8,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 +16,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);
   }