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   3348 use strict;
  2         4  
  2         61  
2 2     2   11 use warnings;
  2         3  
  2         98  
3             # ABSTRACT: Reload libraries with Module::Refresh
4              
5             our $VERSION = '1.003029';
6              
7             use Devel::REPL::Plugin;
8 2     2   10 use namespace::autoclean;
  2         5  
  2         13  
9 2     2   8281 use Module::Refresh;
  2         5  
  2         17  
10 2     2   541  
  2         1151  
  2         173  
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              
27             =pod
28              
29             =encoding UTF-8
30              
31             =head1 NAME
32              
33             Devel::REPL::Plugin::Refresh - Reload libraries with Module::Refresh
34              
35             =head1 VERSION
36              
37             version 1.003029
38              
39             =head1 SUPPORT
40              
41             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL>
42             (or L<bug-Devel-REPL@rt.cpan.org|mailto:bug-Devel-REPL@rt.cpan.org>).
43              
44             There is also an irc channel available for users of this distribution, at
45             L<C<#devel> on C<irc.perl.org>|irc://irc.perl.org/#devel-repl>.
46              
47             =head1 AUTHOR
48              
49             Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>)
50              
51             =head1 COPYRIGHT AND LICENCE
52              
53             This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>).
54              
55             This is free software; you can redistribute it and/or modify it under
56             the same terms as the Perl 5 programming language system itself.
57              
58             =cut