X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL.pm;h=2dc60356f94a0d9592d22ac2bfcf86db5c4014ea;hp=c46dcc6a56402b8bb5217cb0ddb35aeeb5968b40;hb=7faa26c62f9802c210cda1296cd44943bf6f8a2d;hpb=73d11b2472f1796525dae400d71fafce30665ec4 diff --git a/lib/Devel/REPL.pm b/lib/Devel/REPL.pm index c46dcc6..2dc6035 100644 --- a/lib/Devel/REPL.pm +++ b/lib/Devel/REPL.pm @@ -2,32 +2,34 @@ package Devel::REPL; use Term::ReadLine; use Moose; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; use 5.008001; # backwards compat, doesn't warn like 5.8.1 -our $VERSION = '1.003010_01'; +our $VERSION = '1.003019'; with 'MooseX::Object::Pluggable'; use Devel::REPL::Error; has 'term' => ( - is => 'rw', required => 1, + is => 'rw', + lazy => 1, default => sub { Term::ReadLine->new('Perl REPL') } ); has 'prompt' => ( - is => 'rw', required => 1, + is => 'rw', default => sub { '$ ' } ); has 'out_fh' => ( - is => 'rw', required => 1, lazy => 1, + is => 'rw', + lazy => 1, default => sub { shift->term->OUT || \*STDOUT; } ); has 'exit_repl' => ( - is => 'rw', required => 1, + is => 'rw', default => sub { 0 } ); @@ -287,6 +289,34 @@ L L +=item * + +L + +=item * + +L + +=item * + +L + +=item * + +L + +=item * + +L + +=item * + +L + +=item * + +L + =back =head2 Plugins @@ -299,7 +329,9 @@ output, or even add commands to the shell environment. A number of plugins ship with C, and more are available on the CPAN. Some of the shipped plugins are loaded in the default profile, mentioned -above. +above. These plugins can be loaded in your C<< $HOME/.re.pl/repl.rc >> like: + + load_plugin qw( CompletionDriver::Global DumpHistory ); Writing your own plugins is not difficult, and is discussed in the L manual page, along with links to the manual pages of @@ -344,11 +376,7 @@ L >= 0.18 =item * -L >= 0.16 - -=item * - -L +L =item * @@ -442,6 +470,8 @@ Matt S Trout - mst (at) shadowcatsystems.co.uk (L >> + =back =head1 LICENSE