Use requires lexical_environment instead of manually checking in AFTER_PLUGIN
Sartak [Mon, 26 May 2008 02:51:44 +0000 (02:51 +0000)]
git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4406 bd8105ee-0ff8-0310-8827-fb3f25b6796d

lib/Devel/REPL/Plugin/CompletionDriver/LexEnv.pm

index f346bda..a91acca 100644 (file)
@@ -2,13 +2,7 @@ package Devel::REPL::Plugin::CompletionDriver::LexEnv;
 use Devel::REPL::Plugin;
 use namespace::clean -except => [ 'meta' ];
 
-sub AFTER_PLUGIN {
-  my ($_REPL) = @_;
-
-  if (!$_REPL->can('lexical_environment')) {
-    warn "Devel::REPL::Plugin::CompletionDriver::LexEnv requires Devel::REPL::Plugin::LexEnv.";
-  }
-}
+requires 'lexical_environment';
 
 around complete => sub {
   my $orig = shift;