Move to Moo for fast bootstrapping.
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Plugin / Commands.pm
index a4c8fcf..689e656 100644 (file)
@@ -3,7 +3,7 @@ package Devel::REPL::Plugin::Commands;
 use Devel::REPL::Plugin;
 use Scalar::Util qw(weaken);
 
-use namespace::clean -except => [ 'meta' ];
+use namespace::sweep;
 use vars qw($COMMAND_INSTALLER);
 
 has 'command_set' => (
@@ -13,8 +13,11 @@ has 'command_set' => (
 
 sub BEFORE_PLUGIN {
   my ($self) = @_;
+  $self->load_plugin('Packages');
   unless ($self->can('setup_commands')) {
-    $self->meta->add_method('setup_commands' => sub {});
+    my $pkg = ref $self || $self;
+    no strict 'refs';
+    *{"${pkg}::setup_commands"} = sub { };
   }
 }