From: Arthur Axel 'fREW' Schmidt Date: Wed, 10 Feb 2010 07:49:08 +0000 (-0600) Subject: doc patches X-Git-Tag: v1.003015~49 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4761e81ea1521f1daf146e8e5ec066b40d35888;p=p5sagit%2FDevel-REPL.git doc patches --- diff --git a/lib/Devel/REPL/Plugin/DDS.pm b/lib/Devel/REPL/Plugin/DDS.pm index b9c3f33..6e01fe7 100644 --- a/lib/Devel/REPL/Plugin/DDS.pm +++ b/lib/Devel/REPL/Plugin/DDS.pm @@ -31,5 +31,23 @@ __END__ Devel::REPL::Plugin::DDS - Format results with Data::Dump::Streamer +=head1 SYNOPSIS + + # in your re.pl file: + use Devel::REPL; + my $repl = Devel::REPL->new; + $repl->load_plugin('DDS'); + $repl->run; + + # after you run re.pl: + $ map $_*2, ( 1,2,3 ) + $ARRAY1 = [ + 2, + 4, + 6 + ]; + + $ + =cut diff --git a/lib/Devel/REPL/Plugin/LexEnv.pm b/lib/Devel/REPL/Plugin/LexEnv.pm index 05ac905..8c99f17 100644 --- a/lib/Devel/REPL/Plugin/LexEnv.pm +++ b/lib/Devel/REPL/Plugin/LexEnv.pm @@ -68,5 +68,24 @@ __END__ Devel::REPL::Plugin::LexEnv - Provide a lexical environment for the REPL +=head1 SYNOPSIS + + # in your re.pl file: + use Devel::REPL; + my $repl = Devel::REPL->new; + $repl->load_plugin('LexEnv'); + + $repl->lexical_environment->do(<<'CODEZ'); + use FindBin; + use lib "$FindBin::Bin/../lib"; + use MyApp::Schema; + my $s = MyApp::Schema->connect('dbi:Pg:dbname=foo','broseph','elided'); + CODEZ + + $repl->run; + + # after you run re.pl: + $ warn $s->resultset('User')->first->first_name # <-- note that $s works + =cut diff --git a/lib/Devel/REPL/Plugin/ReadLineHistory.pm b/lib/Devel/REPL/Plugin/ReadLineHistory.pm index 619d203..70a79ad 100644 --- a/lib/Devel/REPL/Plugin/ReadLineHistory.pm +++ b/lib/Devel/REPL/Plugin/ReadLineHistory.pm @@ -1,6 +1,6 @@ # First cut at using the readline history directly rather than reimplementing # it. It does save history but it's a little crappy; still playing with it ;) -# +# # epitaph, 22nd April 2007 package Devel::REPL::Plugin::ReadLineHistory; diff --git a/lib/Devel/REPL/Plugin/Timing.pm b/lib/Devel/REPL/Plugin/Timing.pm index 4eb0d27..503d625 100644 --- a/lib/Devel/REPL/Plugin/Timing.pm +++ b/lib/Devel/REPL/Plugin/Timing.pm @@ -30,6 +30,20 @@ __END__ Devel::REPL::Plugin::Timing - display execution times +=head1 SYNOPSIS + + # in your re.pl file: + use Devel::REPL; + my $repl = Devel::REPL->new; + $repl->load_plugin('Timing'); + + # after you run re.pl: + $ sum map $_*100, 1..100000; + Took 0.0830280780792236 seconds. + 500005000000 + + $ + =head1 AUTHOR Shawn M Moore, C<< >>