From: matthewt Date: Mon, 18 Jun 2007 17:06:36 +0000 (+0000) Subject: quick test, update deps, add DDS plugin X-Git-Tag: v1.003015~164 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=950232b2d6e2398c5f804c58e2bedf1e98fd7151;p=p5sagit%2FDevel-REPL.git quick test, update deps, add DDS plugin git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@3510 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/Makefile.PL b/Makefile.PL index 51f2495..c1f1666 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -7,12 +7,16 @@ all_from 'lib/Devel/REPL.pm'; install_script 'script/re.pl'; +build_requires 'Test::More'; requires 'Moose'; requires 'MooseX::Object::Pluggable'; +requires 'MooseX::Getopt'; requires 'namespace::clean'; requires 'File::HomeDir'; requires 'File::Spec'; requires 'Term::ReadLine'; +requires 'Lexical::Persistence'; +requires 'Data::Dump::Streamer'; auto_install; WriteAll; diff --git a/lib/Devel/REPL.pm b/lib/Devel/REPL.pm index 07f3828..3752fd4 100644 --- a/lib/Devel/REPL.pm +++ b/lib/Devel/REPL.pm @@ -5,7 +5,7 @@ use Moose; use namespace::clean -except => [ 'meta' ]; use 5.8.1; # might work with earlier perls but probably not -our $VERSION = '1.000000'; +our $VERSION = '1.001000'; # 1.1.0 with 'MooseX::Object::Pluggable'; @@ -101,6 +101,8 @@ Devel::REPL - a modern perl interactive shell Alternatively, use the 're.pl' script installed with the distribution + system$ re.pl + =head1 AUTHOR Matt S Trout - mst (at) shadowcatsystems.co.uk (L) diff --git a/lib/Devel/REPL/Plugin/DDS.pm b/lib/Devel/REPL/Plugin/DDS.pm new file mode 100644 index 0000000..512d48c --- /dev/null +++ b/lib/Devel/REPL/Plugin/DDS.pm @@ -0,0 +1,22 @@ +package Devel::REPL::Plugin::DDS; + +use Moose::Role; +use Data::Dump::Streamer (); + +around 'print' => sub { + my $orig = shift; + my $self = shift; + my $to_dump = (@_ > 1) ? [@_] : $_[0]; + my $out; + if (ref $to_dump) { + my $dds = Data::Dump::Streamer->new; + $dds->Freezer(sub { "$_[0]"; }); + $dds->Data($to_dump); + $out = $dds->Out; + } else { + $out = $to_dump; + } + $self->$orig($out); +}; + +1; diff --git a/script/re.pl b/script/re.pl index 3b8f6e4..fd2c3df 100755 --- a/script/re.pl +++ b/script/re.pl @@ -1,10 +1,3 @@ #!/usr/bin/env perl -use lib 'lib'; use Devel::REPL::Script 'run'; - -#my $repl = Devel::REPL->new; - -#$repl->load_plugin('History'); -#$repl->load_plugin('LexEnv'); -#$repl->run; diff --git a/t/load_core.t b/t/load_core.t new file mode 100644 index 0000000..c21dc21 --- /dev/null +++ b/t/load_core.t @@ -0,0 +1,9 @@ +use strict; +use warnings; +use Test::More 'no_plan'; + +use_ok('Devel::REPL'); +use_ok('Devel::REPL::Script'); +use_ok('Devel::REPL::Plugin::History'); +use_ok('Devel::REPL::Plugin::LexEnv'); +use_ok('Devel::REPL::Plugin::DDS');