0b18fed0269494ea875926aaf30ddccbf0be181a
[p5sagit/Devel-REPL.git] / lib / Devel / REPL / Plugin / Refresh.pm
1 use strict;
2 use warnings;
3 package Devel::REPL::Plugin::Refresh;
4
5 our $VERSION = '1.003027';
6
7 use Devel::REPL::Plugin;
8 use namespace::autoclean;
9 use Module::Refresh;
10
11 # before evaluating the code, ask Module::Refresh to refresh
12 # the modules that have changed
13 around 'eval' => sub {
14     my $orig = shift;
15     my ($self, $line) = @_;
16
17     # first refresh the changed modules
18     Module::Refresh->refresh;
19
20     # the eval the code
21     return $self->$orig($line);
22 };
23
24 1;
25
26 __END__
27
28 =head1 NAME
29
30 Devel::REPL::Plugin::Refresh - reload libraries with Module::Refresh
31
32 =cut
33