[Bast-commits] r5795 - in trunk/Devel-REPL/lib/Devel: . REPL/Plugin

acmoore at dev.catalyst.perl.org acmoore at dev.catalyst.perl.org
Sun Mar 22 21:50:19 GMT 2009


Author: acmoore
Date: 2009-03-22 21:50:19 +0000 (Sun, 22 Mar 2009)
New Revision: 5795

Modified:
   trunk/Devel-REPL/lib/Devel/REPL.pm
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm
Log:
Adding #pastetitle command to Nopaste plugin

This patch adds the command "#pastetitle" to
Devel::REPL::Plugin::Nopaste. With this command, you can adjust the
title or description that is passed to the nopaste service.

This is my first contribution to Devel::REPL, so I also added myself
to the contributors.



Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm	2009-03-22 21:12:21 UTC (rev 5794)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm	2009-03-22 21:50:19 UTC (rev 5795)
@@ -21,6 +21,14 @@
     },
 );
 
+has paste_title => (
+    metaclass => 'String',
+    is        => 'rw',
+    isa       => 'Str',
+    lazy      => 1,
+    default   => 'Devel::REPL session',
+);
+
 before eval => sub {
     my $self = shift;
     my $line = shift;
@@ -58,11 +66,17 @@
     require App::Nopaste;
     return App::Nopaste->nopaste(
         text => $self->complete_session,
-        desc => "Devel::REPL session",
+        desc => $self->paste_title(),
         lang => "perl",
     );
 }
 
+sub command_pastetitle {
+    my ( $self, undef, $title ) = @_;
+
+    $self->paste_title( $title );
+}
+
 1;
 
 __END__
@@ -71,9 +85,35 @@
 
 Devel::REPL::Plugin::Nopaste - #nopaste to upload session's input and output
 
+=head1 COMMANDS
+
+This module provides these commands to your Devel::REPL shell:
+
+=head2 #nopaste
+
+The C<#nopaste> sends a transcript of your session to a nopaste
+site.
+
+=head2 #pastetitle
+
+The C<#pastetitle> command allows you to set the title of the paste on
+the nopaste site. For example:
+
+C<#pastetitle example of some code>
+
+defaults to 'Devel::REPL session'
+
 =head1 AUTHOR
 
 Shawn M Moore, C<< <sartak at gmail dot com> >>
 
+=head1 CONTRIBUTORS
+
+=over 4
+
+=item Andrew Moore - C<< <amoore at cpan.org> >>
+
+=back
+
 =cut
 

Modified: trunk/Devel-REPL/lib/Devel/REPL.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL.pm	2009-03-22 21:12:21 UTC (rev 5794)
+++ trunk/Devel-REPL/lib/Devel/REPL.pm	2009-03-22 21:50:19 UTC (rev 5795)
@@ -404,6 +404,8 @@
 
 =item Oliver Gorwits - oliver on irc.perl.org
 
+=item Andrew Moore - C<< <amoore at cpan.org> >>
+
 =back
 
 =head1 LICENSE




More information about the Bast-commits mailing list