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

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Thu Nov 8 22:11:21 GMT 2007


Author: matthewt
Date: 2007-11-08 22:11:19 +0000 (Thu, 08 Nov 2007)
New Revision: 3865

Added:
   trunk/Devel-REPL/Changes
Modified:
   trunk/Devel-REPL/lib/Devel/REPL.pm
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm
Log:
fix REPL.pm to obsolete NewlineHack, commit changes file (oops)

Added: trunk/Devel-REPL/Changes
===================================================================
--- trunk/Devel-REPL/Changes	                        (rev 0)
+++ trunk/Devel-REPL/Changes	2007-11-08 22:11:19 UTC (rev 3865)
@@ -0,0 +1,9 @@
+  - deprecate NewlineHack plugin, cause fixed in REPL.pm
+1.1.0
+  - profile system
+  - fix up dependencies
+  - DDS plugin
+  - Commands plugin
+  - Plugin metaclass
+1.0.0
+  - Initial release

Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm	2007-11-07 17:20:53 UTC (rev 3864)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm	2007-11-08 22:11:19 UTC (rev 3865)
@@ -1,3 +1,5 @@
+# Original comment:
+#
 # Adds a newline after print. Some readlines need it some don't. I guess
 # we should clarify whether this is a bug and if so whose bug at some point
 # but this'll do for now ;)
@@ -7,12 +9,12 @@
 use Moose::Role;
 use namespace::clean -except => [ 'meta' ];
 
-after 'print' => sub {
-  # not fussed about args
-  my ($self) = @_;
-  my $fh = $self->out_fh;
-  print $fh "\n";
-};
+warn <<EOW;
+No longer required, extra newline automatically produced for Gnu readline
+implementation by Devel::REPL's print() method.
 
+This plugin will be removed at some point; please remove it from your config.
+EOW
+
 1;
 

Modified: trunk/Devel-REPL/lib/Devel/REPL.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL.pm	2007-11-07 17:20:53 UTC (rev 3864)
+++ trunk/Devel-REPL/lib/Devel/REPL.pm	2007-11-08 22:11:19 UTC (rev 3865)
@@ -36,7 +36,13 @@
   my $line = $self->read;
   return unless defined($line); # undefined value == EOF
   my @ret = $self->eval($line);
-  $self->print(@ret);
+  eval {
+    $self->print(@ret);
+  };
+  if ($@) {
+    my $error = $@;
+    eval { $self->print("Error printing! - $error\n"); };
+  }
   return 1;
 }
 
@@ -87,6 +93,7 @@
   my $fh = $self->out_fh;
   no warnings 'uninitialized';
   print $fh "@ret";
+  print $fh "\n" if $self->term->ReadLine =~ /Gnu/;
 }
 
 =head1 NAME




More information about the Bast-commits mailing list