From 14155824715169efd9bf78b6b94fc9a6409fc254 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 27 Jun 2013 20:53:44 -0400 Subject: update to work with new reply --- lib/Carp/Reply.pm | 2 +- lib/Reply/Plugin/CarpReply.pm | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/Carp/Reply.pm b/lib/Carp/Reply.pm index b791cd4..c8d29c2 100644 --- a/lib/Carp/Reply.pm +++ b/lib/Carp/Reply.pm @@ -3,7 +3,7 @@ use strict; use warnings; # ABSTRACT: get a repl on exceptions in your program -use Reply 0.13; +use Reply 0.18; use Reply::Config; =head1 SYNOPSIS diff --git a/lib/Reply/Plugin/CarpReply.pm b/lib/Reply/Plugin/CarpReply.pm index 7206348..3f9622f 100644 --- a/lib/Reply/Plugin/CarpReply.pm +++ b/lib/Reply/Plugin/CarpReply.pm @@ -30,21 +30,11 @@ sub new { $self->{stacktrace} = Devel::StackTrace::WithLexicals->new( ignore_class => ['Reply', 'Carp::Reply', __PACKAGE__], ); - $self->{frame_index} = 0; + $self->_frame_index(0); return $self; } -sub compile { - my $self = shift; - my ($next, $line, %opts) = @_; - - $opts{environment} = $self->_frame->lexicals; - $opts{package} = $self->_frame->package; - - return $next->($line, %opts); -} - sub command_backtrace { my $self = shift; print "Backtrace:\n"; @@ -137,6 +127,12 @@ sub _frame_index { printf "Now at %s:%s (frame $index)\n", $self->_frame->filename, $self->_frame->line; + + $self->publish( + 'lexical_environment', + default => $self->_frame->lexicals + ); + $self->publish('package', $self->_frame->package); } } -- cgit v1.2.3-54-g00ecf