summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-03-06 01:15:51 -0600
committerJesse Luehrs <doy@tozt.net>2012-03-06 01:15:51 -0600
commite0d0fe735ad736b1a7cf04a7662b54bac568e4f1 (patch)
tree3299e85248f9789d6b11da9dabd6e824af271f76 /lib
parentce88f2dbca2f57ad70366c66a92bb0edf3746ac7 (diff)
downloadapp-ttyrec-e0d0fe735ad736b1a7cf04a7662b54bac568e4f1.tar.gz
app-ttyrec-e0d0fe735ad736b1a7cf04a7662b54bac568e4f1.zip
update for new Term::Filter api
Diffstat (limited to 'lib')
-rw-r--r--lib/App/Ttyrec.pm33
1 files changed, 10 insertions, 23 deletions
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;