X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL.pm;h=b0fce4e4b2d9dfb1e911815169a347244622309d;hp=73a0febac57260bf3eb5fc72b557c5c9e496506a;hb=moo;hpb=9b7bfb6ac233dca407f12db47aa8dda7c9c1d338 diff --git a/lib/Devel/REPL.pm b/lib/Devel/REPL.pm index 73a0feb..b0fce4e 100644 --- a/lib/Devel/REPL.pm +++ b/lib/Devel/REPL.pm @@ -1,15 +1,30 @@ package Devel::REPL; use Term::ReadLine; -use Moose; -use namespace::autoclean; +use Moo; +use namespace::sweep; use 5.008001; # backwards compat, doesn't warn like 5.8.1 our $VERSION = '1.003014'; -with 'MooseX::Object::Pluggable'; - use Devel::REPL::Error; +use Scalar::Util qw/blessed/; +use Module::Runtime (); + +sub load_plugin { + my ($self, $plugin) = @_; + $plugin = "Devel::REPL::Plugin::$plugin"; + Module::Runtime::use_module("$plugin"); + if (my $pre = $plugin->can('BEFORE_PLUGIN')) { + $pre->($self, $plugin); + } + Moo::Role->apply_roles_to_package( + 'Devel::REPL', $plugin + ); + if (my $pre = $plugin->can('AFTER_PLUGIN')) { + $pre->($self, $plugin); + } +} has 'term' => ( is => 'rw', required => 1, @@ -366,15 +381,11 @@ L >= 0.74 =item * -L >= 0.0009 - -=item * - L >= 0.18 =item * -L +L =item *