| 1 | # | ||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||
| 3 | # | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package Rex::Cron::FreeBSD; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | use v5.14.4; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | our $VERSION = '1.16.1'; # VERSION | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 1 | ▶ | use Rex::Cron::Base; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 1 | ▶ | use base qw(Rex::Cron::Base); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | ▶ | use Rex::Helper::Run; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 1 | ▶ | use Rex::Helper::Path; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 19 | 0 | my $that = shift; | |||||||||||||||||||
| 20 | 0 | ▶ | my $proto = ref($that) || $that; | ||||||||||||||||||
|
Condition0%0/3
ref $that || $that
MC/DC0%0/2
ref $that || $that
ref $that
$that
Truth table0%0/3
A || B
A= ref $thatB= $that
| |||||||||||||||||||||
| 21 | 0 | my $self = $proto->SUPER::new(@_); | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | bless( $self, $proto ); | |||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 0 | return $self; | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | ▶ | sub read_user_cron { | ||||||||||||||||||
|
Subroutine
read_user_cron: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 29 | 0 | my ( $self, $user ) = @_; | |||||||||||||||||||
| 30 | 0 | ▶ | $user = undef if $user eq $self->_whoami; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 0 | my $tmp_file = get_tmp_file; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | my $command = '( crontab -l'; | |||||||||||||||||||
| 35 | 0 | ▶ | $command .= " -u $user" if defined $user; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 36 | 0 | $command .= " >$tmp_file ) >& /dev/null ; cat $tmp_file ; rm $tmp_file"; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 0 | my @lines = i_run $command; | |||||||||||||||||||
| 39 | 0 | $self->parse_cron(@lines); | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 1 | 1; | |||||||||||||||||||