File Coverage

blib/lib/Devel/REPL/Plugin/Refresh.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1 2     2   6017 use strict;
  2         5  
  2         83  
2 2     2   12 use warnings;
  2         3  
  2         147  
3             package Devel::REPL::Plugin::Refresh;
4             # ABSTRACT: Reload libraries with Module::Refresh
5              
6             our $VERSION = '1.003027';
7              
8 2     2   10 use Devel::REPL::Plugin;
  2         4  
  2         20  
9 2     2   10265 use namespace::autoclean;
  2         5  
  2         26  
10 2     2   725 use Module::Refresh;
  2         1067  
  2         224  
11              
12             # before evaluating the code, ask Module::Refresh to refresh
13             # the modules that have changed
14             around 'eval' => sub {
15             my $orig = shift;
16             my ($self, $line) = @_;
17              
18             # first refresh the changed modules
19             Module::Refresh->refresh;
20              
21             # the eval the code
22             return $self->$orig($line);
23             };
24              
25             1;
26              
27             __END__
28              
29             =pod
30              
31             =encoding UTF-8
32              
33             =head1 NAME
34              
35             Devel::REPL::Plugin::Refresh - Reload libraries with Module::Refresh
36              
37             =head1 VERSION
38              
39             version 1.003027
40              
41             =head1 AUTHOR
42              
43             Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>)
44              
45             =head1 COPYRIGHT AND LICENSE
46              
47             This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>).
48              
49             This is free software; you can redistribute it and/or modify it under
50             the same terms as the Perl 5 programming language system itself.
51              
52             =cut