[Bast-commits] r3205 - in trunk/Devel-REPL/lib/Devel: . REPL/Plugin
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Sun Apr 22 15:32:45 GMT 2007
Author: matthewt
Date: 2007-04-22 15:32:44 +0100 (Sun, 22 Apr 2007)
New Revision: 3205
Modified:
trunk/Devel-REPL/lib/Devel/REPL.pm
trunk/Devel-REPL/lib/Devel/REPL/Plugin/History.pm
trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm
trunk/Devel-REPL/lib/Devel/REPL/Plugin/ShowClass.pm
trunk/Devel-REPL/lib/Devel/REPL/Plugin/Turtles.pm
Log:
rejig to provide $REPL instead of $self, fix namespace::clean usage to not nuke meta
Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/History.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/History.pm 2007-04-22 13:46:23 UTC (rev 3204)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/History.pm 2007-04-22 14:32:44 UTC (rev 3205)
@@ -1,6 +1,7 @@
package Devel::REPL::Plugin::History;
use Moose::Role;
+use namespace::clean -except => [ 'meta' ];
has 'history' => (
isa => 'ArrayRef', is => 'rw', required => 1, lazy => 1,
Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm 2007-04-22 13:46:23 UTC (rev 3204)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/NewlineHack.pm 2007-04-22 14:32:44 UTC (rev 3205)
@@ -5,9 +5,8 @@
package Devel::REPL::Plugin::NewlineHack;
use Moose::Role;
+use namespace::clean -except => [ 'meta' ];
-use Data::Dumper;
-
after 'print' => sub {
# not fussed about args
my ($self) = @_;
Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/ShowClass.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/ShowClass.pm 2007-04-22 13:46:23 UTC (rev 3204)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/ShowClass.pm 2007-04-22 14:32:44 UTC (rev 3205)
@@ -1,5 +1,6 @@
package Devel::REPL::Plugin::ShowClass;
use Moose::Role;
+use namespace::clean -except => [ 'meta' ];
has 'metaclass_cache' => (
is => 'ro',
Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/Turtles.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/Turtles.pm 2007-04-22 13:46:23 UTC (rev 3204)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/Turtles.pm 2007-04-22 14:32:44 UTC (rev 3205)
@@ -1,11 +1,12 @@
package Devel::REPL::Plugin::Turtles;
use Moose::Role;
+use namespace::clean -except => [ 'meta' ];
around 'eval' => sub {
my $next = shift;
my ($self, $line) = @_;
if ($line =~ /^#(.*)/) {
- return $next->($self, ('$self->' . $1 . '; return();'));
+ return $next->($self, ('$REPL->' . $1 . '; return();'));
}
else {
return $next->($self, $line);
@@ -13,4 +14,4 @@
};
-1;
\ No newline at end of file
+1;
Modified: trunk/Devel-REPL/lib/Devel/REPL.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL.pm 2007-04-22 13:46:23 UTC (rev 3204)
+++ trunk/Devel-REPL/lib/Devel/REPL.pm 2007-04-22 14:32:44 UTC (rev 3205)
@@ -2,7 +2,7 @@
use Term::ReadLine;
use Moose;
-use namespace::clean;
+use namespace::clean -except => [ 'meta' ];
with 'MooseX::Object::Pluggable';
@@ -51,9 +51,9 @@
}
sub compile {
- my ($self, $line) = @_;
- my $compiled = eval $self->wrap_as_sub($line);
- return (undef, $self->error_return("Compile error", $@)) if $@;
+ my $REPL = shift;
+ my $compiled = eval $REPL->wrap_as_sub($_[0]);
+ return (undef, $REPL->error_return("Compile error", $@)) if $@;
return $compiled;
}
@@ -68,9 +68,9 @@
}
sub execute {
- my $REPL = shift;
- my @ret = eval { shift->(@_) };
- return $REPL->error_return("Runtime error", $@) if $@;
+ my ($self, $to_exec, @args) = @_;
+ my @ret = eval { $to_exec->(@args) };
+ return $self->error_return("Runtime error", $@) if $@;
return @ret;
}
More information about the Bast-commits
mailing list