| 1 | package Net::CLI::Interact::Transport::Wrapper::Net_Telnet; | ||||||||||
| 2 | { | ||||||||||
| 3 | 1 | $Net::CLI::Interact::Transport::Wrapper::Net_Telnet::VERSION = '2.143070'; | |||||||||
| 4 | } | ||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Sub::Quote; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use MooX::Types::MooseLike::Base qw(Str InstanceOf); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | extends 'Net::CLI::Interact::Transport::Wrapper::Base'; | |||||||||
| 11 | |||||||||||
| 12 | { | ||||||||||
| 13 | 1 | package # hide from pause | |||||||||
| 14 | Net::CLI::Interact::Transport::Wrapper::Options; | ||||||||||
| 15 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 1 | extends 'Net::CLI::Interact::Transport::Wrapper::Base::Options'; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub put { (shift)->wrapper->put( join '', @_ ) } | ||||||||
|
Subroutine
put: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 20 | |||||||||||
| 21 | 1 | has '_buffer' => ( | |||||||||
| 22 | is => 'rw', | ||||||||||
| 23 | isa => Str, | ||||||||||
| 24 | default => quote_sub(q{''}), | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | sub buffer { | ||||||||||
| 28 | 4 | ▶ | my $self = shift; | ||||||||
|
Subroutine
buffer: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 4 | ▶ | return $self->_buffer if scalar(@_) == 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 2 | return $self->_buffer(shift); | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | sub pump { | ||||||||||
| 34 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
pump: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 35 | 0 | my $content = $self->wrapper->get(Timeout => $self->timeout); | |||||||||
| 36 | 0 | ▶ | $self->_buffer($self->_buffer . $content) if defined $content; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 1 | has '+timeout' => ( | |||||||||
| 40 | trigger => 1, | ||||||||||
| 41 | ); | ||||||||||
| 42 | |||||||||||
| 43 | sub _trigger_timeout { | ||||||||||
| 44 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_trigger_timeout: not called CC=3 SCAR=24.8
| |||||||||||
| 45 | 0 | ▶ | if (scalar @_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | my $timeout = shift; | |||||||||
| 47 | 0 | ▶ | if ($self->connect_ready) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 0 | $self->wrapper->timeout($timeout); | |||||||||
| 49 | } | ||||||||||
| 50 | } | ||||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 1 | has '+wrapper' => ( | |||||||||
| 54 | isa => InstanceOf['Net::Telnet'], | ||||||||||
| 55 | ); | ||||||||||
| 56 | |||||||||||
| 57 | around '_build_wrapper' => sub { | ||||||||||
| 58 | 0 | ▶ | my ($orig, $self) = (shift, shift); | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 59 | |||||||||||
| 60 | 0 | $self->logger->log('transport', 'notice', 'creating Net::Telnet wrapper for', $self->app); | |||||||||
| 61 | 0 | $self->$orig(@_); | |||||||||
| 62 | |||||||||||
| 63 | 0 | ▶ | $SIG{CHLD} = 'IGNORE' | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | if not $self->connect_options->reap; | ||||||||||
| 65 | |||||||||||
| 66 | 0 | with 'Net::CLI::Interact::Transport::Role::ConnectCore'; | |||||||||
| 67 | 0 | return $self->connect_core($self->app, $self->runtime_options); | |||||||||
| 68 | 1 | }; | |||||||||
| 69 | |||||||||||
| 70 | after 'disconnect' => sub { | ||||||||||
| 71 | 2 | ▶ | delete $SIG{CHLD}; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 72 | 1 | }; | |||||||||
| 73 | |||||||||||
| 74 | 1 | 1; | |||||||||