git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@5424
bd8105ee-0ff8-0310-8827-fb3f25b6796d
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
use Devel::REPL::Plugin;
use MooseX::AttributeHelpers;
use namespace::clean -except => [ 'meta' ];
+use Scalar::Util qw(blessed);
sub BEFORE_PLUGIN {
my $self = shift;
my $line = shift;
my @ret = $orig->($self, $line, @_);
-
- $self->add_to_session(join("\n", @ret) . "\n\n");
+ my @ret_as_str = map {
+ if (!defined($_)) {
+ '';
+ } elsif (blessed($_) && $_->can('stringify')) {
+ $_->stringify();
+ } else {
+ $_;
+ }
+ } @ret;
+
+ $self->add_to_session(join("\n", @ret_as_str) . "\n\n");
return @ret;
};