line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bat::Interpreter::Delegate::Executor::PartialDryRunner; |
2
|
|
|
|
|
|
|
|
3
|
25
|
|
|
25
|
|
204
|
use utf8; |
|
25
|
|
|
|
|
63
|
|
|
25
|
|
|
|
|
196
|
|
4
|
|
|
|
|
|
|
|
5
|
25
|
|
|
25
|
|
833
|
use Moo; |
|
25
|
|
|
|
|
66
|
|
|
25
|
|
|
|
|
159
|
|
6
|
25
|
|
|
25
|
|
8373
|
use Types::Standard qw(ArrayRef); |
|
25
|
|
|
|
|
63
|
|
|
25
|
|
|
|
|
268
|
|
7
|
25
|
|
|
25
|
|
16519
|
use namespace::autoclean; |
|
25
|
|
|
|
|
70
|
|
|
25
|
|
|
|
|
601
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Bat::Interpreter::Role::Executor'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.024'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has 'commands_executed' => ( is => 'ro', |
14
|
|
|
|
|
|
|
isa => ArrayRef, |
15
|
|
|
|
|
|
|
default => sub { [] }, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub add_command { |
19
|
33
|
|
|
33
|
1
|
69
|
push @{ shift->commands_executed }, @_; |
|
33
|
|
|
|
|
195
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub execute_command { |
23
|
33
|
|
|
33
|
1
|
377
|
my $self = shift(); |
24
|
33
|
|
|
|
|
79
|
my $command = shift(); |
25
|
33
|
|
|
|
|
147
|
$self->add_command($command); |
26
|
33
|
|
|
|
|
95
|
return 0; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub execute_for_command { |
30
|
1
|
|
|
1
|
1
|
10
|
my $self = shift(); |
31
|
1
|
|
|
|
|
3
|
my $command = shift(); |
32
|
1
|
|
|
|
|
8670
|
my $output = `$command`; |
33
|
1
|
|
|
|
|
27
|
chomp $output; |
34
|
1
|
|
|
|
|
75
|
return $output; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |