From 7eb59745705e47bcdabfb025c68adf70db8dd746 Mon Sep 17 00:00:00 2001 From: Michael Reddick Date: Thu, 20 Jun 2013 14:22:47 -0500 Subject: AutoRefresh plugin --- dist.ini | 1 + lib/Reply/Plugin/AutoRefresh.pm | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 lib/Reply/Plugin/AutoRefresh.pm diff --git a/dist.ini b/dist.ini index ad49292..48ce4a2 100644 --- a/dist.ini +++ b/dist.ini @@ -32,3 +32,4 @@ Data::Dump = 0 Data::Printer = 0 Proc::InvokeEditor = 0 Term::ReadLine::Gnu = 0 +Class::Refresh = 0 diff --git a/lib/Reply/Plugin/AutoRefresh.pm b/lib/Reply/Plugin/AutoRefresh.pm new file mode 100644 index 0000000..6341c9d --- /dev/null +++ b/lib/Reply/Plugin/AutoRefresh.pm @@ -0,0 +1,29 @@ +package Reply::Plugin::AutoRefresh; +use strict; +use warnings; +# ABSTRACT: provides a more informative prompt + +use base 'Reply::Plugin'; +use Class::Refresh; + +=head1 SYNOPSIS + + ; .replyrc + [AutoRefresh] + +=head1 DESCRIPTION + +This plugin automatically refreshes all loaded modules after every +statement execution. It's useful if you are working on a module in +a file and you want the changes to automatically be loaded in reply. + +=cut + +sub execute { + my $self = shift; + my ($next, @args) = @_; + + Class::Refresh->refresh; + $next->(@args); +} +1; -- cgit v1.2.3-54-g00ecf