summaryrefslogtreecommitdiffstats
path: root/lib/Reply/Plugin/AutoRefresh.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Reply/Plugin/AutoRefresh.pm')
-rw-r--r--lib/Reply/Plugin/AutoRefresh.pm29
1 files changed, 29 insertions, 0 deletions
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;