Interact/Transport/Loopback.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 1 / 1 totaltotal 86.2% 25 / 29 CC 1 SCAR 2.5
CC
1
Cov
90%
_build_app
2.0
runtime_options
2.0
BEGIN
1.0
CRAP 1.3
« Interact/Transport/Base.pm ↑ Summary Interact/Transport/Platform/Unix.pm »
1 package Net::CLI::Interact::Transport::Loopback;
2 2 $Net::CLI::Interact::Transport::Loopback::VERSION = '2.400002';
3 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Sub::Quote;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use MooX::Types::MooseLike::Base qw(InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 extends 'Net::CLI::Interact::Transport::Base';
8  
9 {
10 2 package # hide from pause
11 Net::CLI::Interact::Transport::Loopback::Options;
12  
13 2 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 extends 'Net::CLI::Interact::Transport::Options';
15 }
16  
17 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18  
19 has 'connect_options' => (
20 is => 'ro',
21 isa => InstanceOf['Net::CLI::Interact::Transport::Loopback::Options'],
22 2 ▶ default => sub { {} },
Subroutine __ANON__: called CC=1 SCAR=0.0
23 2 coerce => quote_sub(
24 q{ Net::CLI::Interact::Transport::Loopback::Options->new(@_) if ref '' ne ref $_[0] }),
25 required => 1,
26 );
27  
28 #sub _which_perl {
29 # use Config;
30 # $secure_perl_path = $Config{perlpath};
31 # if ($^O ne 'VMS')
32 # {$secure_perl_path .= $Config{_exe}
33 # unless $secure_perl_path =~ m/$Config{_exe}$/i;}
34 # return $secure_perl_path;
35 #}
36  
37 0 ▶sub _build_app { return $^X }
Subroutine _build_app: not called CC=1 SCAR=6.9
38  
39 0 ▶sub runtime_options {
Subroutine runtime_options: not called CC=1 SCAR=6.9
Pod documented
40 0 return ('-ne', 'BEGIN { $| = 1 }; print $_, time, "\nPROMPT> ";');
41 }
42  
43 2 1;
44  
45 =pod
46  
47 =head1 NAME
48  
49 Net::CLI::Interact::Transport::Loopback - Testable CLI connection
50  
51 =head1 DECRIPTION
52  
53 This module provides a wrapped instance of Perl which simply echoes back any
54 input provided. This is used for the L<Net::CLI::Interact> test suite.
55  
56 =head1 INTERFACE
57  
58 =head2 app
59  
60 Defaults to the value of C<$^X> (that is, Perl itself).
61  
62 =head2 runtime_options
63  
64 Returns Perl options which turn it into a CLI emulator:
65  
66 -ne 'BEGIN { $| = 1 }; print $_, time, "\nPROMPT>\n";'
67  
68 For example:
69  
70 some command
71 some command
72 1301578196
73 PROMPT>
74  
75 In this case the output command was "some command" which was echoed, followed
76 by the dummy command output (epoch seconds), followed by a "prompt".
77  
78 =head1 COMPOSITION
79  
80 See the following for further interface details:
81  
82 =over 4
83  
84 =item *
85  
86 L<Net::CLI::Interact::Transport::Base>
87  
88 =back
89  
90 =cut
91  
« Interact/Transport/Base.pm ↑ Summary Interact/Transport/Platform/Unix.pm »