summaryrefslogtreecommitdiffstats
path: root/lib/Reply/Plugin/LoadClass.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-06-03 15:18:17 -0500
committerJesse Luehrs <doy@tozt.net>2013-06-03 15:51:17 -0500
commitec069554b263d4d3a60a315089e170b92badd1d8 (patch)
tree38e4b6cb2196ee0b56aa33c29df3a94c53ad1e20 /lib/Reply/Plugin/LoadClass.pm
parent60f235d03fba8232e7f691550ee715e1cfb9c5b6 (diff)
downloadreply-ec069554b263d4d3a60a315089e170b92badd1d8.tar.gz
reply-ec069554b263d4d3a60a315089e170b92badd1d8.zip
start on some docs
Diffstat (limited to 'lib/Reply/Plugin/LoadClass.pm')
-rw-r--r--lib/Reply/Plugin/LoadClass.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Reply/Plugin/LoadClass.pm b/lib/Reply/Plugin/LoadClass.pm
index 8bba634..a225cdd 100644
--- a/lib/Reply/Plugin/LoadClass.pm
+++ b/lib/Reply/Plugin/LoadClass.pm
@@ -1,12 +1,28 @@
package Reply::Plugin::LoadClass;
use strict;
use warnings;
+# ABSTRACT: attempts to load classes implicitly if possible
use base 'Reply::Plugin';
use Module::Runtime 'use_package_optimistically';
use Try::Tiny;
+=head1 SYNOPSIS
+
+ ; .replyrc
+ [LoadClass]
+
+=head1 DESCRIPTION
+
+If executing a line of code fails due to a method not being defined on a
+package, this plugin will load the corresponding module and then try executing
+the line again. This simplifies common cases like running C<< DateTime->now >>
+at the prompt before loading L<DateTime> - this plugin will cause DateTime to
+be loaded implicitly.
+
+=cut
+
sub execute {
my $self = shift;
my ($next, @args) = @_;