From e0d0fe735ad736b1a7cf04a7662b54bac568e4f1 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 6 Mar 2012 01:15:51 -0600 Subject: update for new Term::Filter api --- lib/App/Ttyrec.pm | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'lib') diff --git a/lib/App/Ttyrec.pm b/lib/App/Ttyrec.pm index b5c16fb..828556c 100644 --- a/lib/App/Ttyrec.pm +++ b/lib/App/Ttyrec.pm @@ -3,9 +3,10 @@ use Moose; # ABSTRACT: record interactive terminal sessions use Scalar::Util 'weaken'; -use Term::Filter; use Tie::Handle::TtyRec 0.04; +with 'Term::Filter'; + has ttyrec_file => ( is => 'ro', isa => 'Str', @@ -28,28 +29,14 @@ has ttyrec => ( }, ); -has term => ( - is => 'ro', - isa => 'Term::Filter', - lazy => 1, - default => sub { - my $_self = shift; - weaken(my $self = $_self); - Term::Filter->new( - callbacks => { - munge_output => sub { - my $term = shift; - my ($got) = @_; - - syswrite $self->ttyrec, $got; - - $got; - }, - }, - ); - }, - handles => ['run'], -); +sub munge_output { + my $self = shift; + my ($got) = @_; + + syswrite $self->ttyrec, $got; + + $got; +} __PACKAGE__->meta->make_immutable; no Moose; -- cgit v1.2.3-54-g00ecf