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

oliver at dev.catalyst.perl.org oliver at dev.catalyst.perl.org
Sat Feb 7 17:21:13 GMT 2009


Author: oliver
Date: 2009-02-07 17:21:13 +0000 (Sat, 07 Feb 2009)
New Revision: 5424

Modified:
   trunk/Devel-REPL/Changes
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm
Log:
resolve rt.cpan#42904 Nopaste plugin handle undef error messages

Modified: trunk/Devel-REPL/Changes
===================================================================
--- trunk/Devel-REPL/Changes	2009-02-07 17:07:03 UTC (rev 5423)
+++ trunk/Devel-REPL/Changes	2009-02-07 17:21:13 UTC (rev 5424)
@@ -1,6 +1,7 @@
 1.3.3
   - make Nopaste attribute lazy
   - make ReadLineHistory history file location portable
+  - resolve rt.cpan#42904 Nopaste plugin handle undef error messages
 1.3.2
   - make plugins be M::I features so dependencies are optional
   - resolve rt.cpan#42506 readdir might fail

Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm	2009-02-07 17:07:03 UTC (rev 5423)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/Nopaste.pm	2009-02-07 17:21:13 UTC (rev 5424)
@@ -3,6 +3,7 @@
 use Devel::REPL::Plugin;
 use MooseX::AttributeHelpers;
 use namespace::clean -except => [ 'meta' ];
+use Scalar::Util qw(blessed);
 
 sub BEFORE_PLUGIN {
     my $self = shift;
@@ -36,8 +37,17 @@
     my $line = shift;
 
     my @ret = $orig->($self, $line, @_);
+    my @ret_as_str = map {
+        if (!defined($_)) {
+            '';
+        } elsif (blessed($_) && $_->can('stringify')) {
+            $_->stringify();
+        } else {
+            $_;
+        }
+    } @ret;
 
-    $self->add_to_session(join("\n", @ret) . "\n\n");
+    $self->add_to_session(join("\n", @ret_as_str) . "\n\n");
 
     return @ret;
 };




More information about the Bast-commits mailing list