summaryrefslogtreecommitdiffstats
path: root/lib/App/REPL/Plugin/Colors.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-05-30 03:12:25 -0500
committerJesse Luehrs <doy@tozt.net>2013-05-30 03:12:25 -0500
commit071e98547d4dda83c29ea87cd4cff9115667bf24 (patch)
tree5b20f0019eb42b385f7a452c973991a1149ef625 /lib/App/REPL/Plugin/Colors.pm
parent34218fd2af78b254dd424de2289981621ee85f94 (diff)
downloadreply-071e98547d4dda83c29ea87cd4cff9115667bf24.tar.gz
reply-071e98547d4dda83c29ea87cd4cff9115667bf24.zip
split evaluate into compile and execute
Diffstat (limited to 'lib/App/REPL/Plugin/Colors.pm')
-rw-r--r--lib/App/REPL/Plugin/Colors.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/App/REPL/Plugin/Colors.pm b/lib/App/REPL/Plugin/Colors.pm
index b06f857..dc00cfd 100644
--- a/lib/App/REPL/Plugin/Colors.pm
+++ b/lib/App/REPL/Plugin/Colors.pm
@@ -17,7 +17,15 @@ sub new {
return $self;
}
-sub evaluate {
+sub compile {
+ my $self = shift;
+ my ($next, @args) = @_;
+
+ local $SIG{__WARN__} = sub { $self->print_warn(@_) };
+ $next->(@args);
+}
+
+sub execute {
my $self = shift;
my ($next, @args) = @_;