| 1 | package Toadfarm::Command::restart; | ||||||||||||||||||||
| 2 | 1 | ▶ | use Mojo::Base 'Toadfarm::Command::stop'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | 1 | has description => 'Toadfarm: Restart or start the server'; | |||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 3 | ▶ | sub run { | ||||||||||||||||||
|
Subroutine
run: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||
| 7 | 3 | my $self = shift; | |||||||||||||||||||
| 8 | 3 | my $exit = $self->_restart; | |||||||||||||||||||
| 9 | 3 | ▶ | return $exit if $ENV{TOADFARM_NO_EXIT}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 10 | 0 | exit $exit; | |||||||||||||||||||
| 11 | } | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 3 | ▶ | sub _restart { | ||||||||||||||||||
|
Subroutine
_restart: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 14 | 3 | my ($self, @args) = @_; | |||||||||||||||||||
| 15 | 3 | my $exit; | |||||||||||||||||||
| 16 | 3 | local $ENV{TOADFARM_NO_EXIT} = 1; | |||||||||||||||||||
| 17 | 3 | ▶ | $exit ||= $self->$_(@args) for qw(_stop _start); | ||||||||||||||||||
|
Condition100%3/3
$exit ||= $self->$_(@args)
MC/DC100%2/2
$exit ||= $self->$_(@args)
$exit
$self->$_(@args)
Truth table100%3/3
A ||= B
A= $exitB= $self->$_(@args)
| |||||||||||||||||||||
| 18 | 3 | return $exit; | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 1 | 1; | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | =encoding utf8 | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | =head1 NAME | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | Toadfarm::Command::restart - Restart a Toadfarm DSL script | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =head1 DESCRIPTION | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | L<Toadfarm::Command::restart> is a command for restarting a L<Toadfarm> | ||||||||||||||||||||
| 32 | application. | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | =head1 SYNOPSIS | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | $ /path/to/script.pl restart | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | =head1 ATTRIBUTES | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | =head2 description | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | Short description of command, used for the command list. | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | =head1 METHODS | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | =head2 run | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | Run command. | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | Copyright (C) 2014, Jan Henning Thorsen | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | This program is free software, you can redistribute it and/or modify it under | ||||||||||||||||||||
| 55 | the terms of the Artistic License version 2.0. | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | =head1 AUTHOR | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | Jan Henning Thorsen - C<jhthorsen@cpan.org> | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | =cut | ||||||||||||||||||||