X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FNopaste.pm;h=b078af2250e161abff5ccc0a09e05ff8a1f39ff6;hp=19e30ae976153a32f4c77ddae10cfb857f2e8aaa;hb=6631e15ccd2313ff350fd9bfa44c1ccdbac77100;hpb=24cc824faa918e5ac9f61b122d7e22b1fc47219d diff --git a/lib/Devel/REPL/Plugin/Nopaste.pm b/lib/Devel/REPL/Plugin/Nopaste.pm index 19e30ae..b078af2 100644 --- a/lib/Devel/REPL/Plugin/Nopaste.pm +++ b/lib/Devel/REPL/Plugin/Nopaste.pm @@ -16,21 +16,24 @@ has complete_session => ( }, ); -around eval => sub { - my $orig = shift; +before eval => sub { my $self = shift; my $line = shift; - my @ret = $orig->($self, $line, @_); - # prepend each line with # $line =~ s/^/# /mg; - my $step = $line . "\n" - . join("\n", @ret) - . "\n\n"; + $self->add_to_session($line . "\n"); +}; + +around eval => sub { + my $orig = shift; + my $self = shift; + my $line = shift; + + my @ret = $orig->($self, $line, @_); - $self->add_to_session($step); + $self->add_to_session(join("\n", @ret) . "\n\n"); return @ret; }; @@ -48,3 +51,15 @@ sub command_nopaste { 1; +__END__ + +=head1 NAME + +Devel::REPL::Plugin::Nopaste - #nopaste to upload session's input and output + +=head1 AUTHOR + +Shawn M Moore, C<< >> + +=cut +