Skip to content

Commit

Permalink
fix misnamed attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jrockway committed May 3, 2010
1 parent 57aa3ce commit 833b895
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/AnyEvent/REPL.pm
Expand Up @@ -108,7 +108,7 @@ class AnyEvent::REPL {
$backend->load_plugins(@{$args->{backend_plugins} || []});

my $frontend = AnyEvent::REPL::Frontend->new(
pty => $args->{comm},
fh => $args->{comm},
);

my $loop = AnyEvent::REPL::Loop->
Expand Down
7 changes: 4 additions & 3 deletions lib/AnyEvent/REPL/Frontend.pm
Expand Up @@ -3,14 +3,14 @@ use MooseX::Declare;
class AnyEvent::REPL::Frontend with Devel::REPL::Frontend::API {
use JSON;

has 'pty' => (
has 'fh' => (
is => 'ro',
isa => 'GlobRef',
required => 1,
);

method read {
my $fh = $self->pty;
my $fh = $self->fh;

my $request_json = <$fh>;
return if !$request_json;
Expand All @@ -20,6 +20,7 @@ class AnyEvent::REPL::Frontend with Devel::REPL::Frontend::API {
}

method print(Ref $response) {
syswrite $self->pty, encode_json $response;
my $result = encode_json $response;
syswrite $self->fh, $result;
}
}

0 comments on commit 833b895

Please sign in to comment.