git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@3708
bd8105ee-0ff8-0310-8827-fb3f25b6796d
--- /dev/null
+package Devel::REPL::Plugin::Refresh;
+
+use Moose::Role;
+use namespace::clean -except => [ 'meta' ];
+use Module::Refresh;
+
+# before evaluating the code, ask Module::Refresh to refresh
+# the modules that have changed
+around 'eval' => sub {
+ my $orig = shift;
+ my ($self, $line) = @_;
+
+ # first refresh the changed modules
+ Module::Refresh->refresh;
+
+ # the eval the code
+ return $self->$orig($line);
+};
+
+1;
with 'Devel::REPL::Profile';
sub plugins {
- qw(History LexEnv DDS Packages Commands);
+ qw(History LexEnv DDS Packages Commands Refresh);
}
sub apply_profile {