| 1 | #!/usr/bin/env perl | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use Mojolicious::Lite; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use Getopt::Long qw{ :config posix_default no_ignore_case gnu_compat pass_through }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 3 | my $opts = +{}; | |||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | GetOptions( $opts, qw{ file=s webtailrc=s tail-opts=s v|verbose } ) or help(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | ▶ | help() if ( $ENV{MOJO_HELP} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | sub help { exec "perldoc $0" } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
help: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | ▶ | if ( !$opts->{webtailrc} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
not $opts->{"webtailrc"} and $ENV{"HOME"} and -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
not $opts->{"webtailrc"} and $ENV{"HOME"}
MC/DC0%0/3
not $opts->{"webtailrc"} and $ENV{"HOME"} and -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
not $opts->{"webtailrc"}
$ENV{"HOME"}
-e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
Truth table50%2/4
not(A) and B and C
A= not $opts->{"webtailrc"}B= $ENV{"HOME"}C= -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | && $ENV{HOME} | ||||||||||||||||||||||||||||||||||||||||||
| 14 | && -e ( my $webtailrc = File::Spec->catfile( $ENV{HOGE}, '.webtailrc' ) ) | ||||||||||||||||||||||||||||||||||||||||||
| 15 | ) | ||||||||||||||||||||||||||||||||||||||||||
| 16 | { | ||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | $opts->{webtailrc} = $webtailrc; | |||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 3 | ▶ | app->log->level('info') unless ( $opts->{v} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 3 | plugin 'Webtail', file => $opts->{file}, webtailrc => $opts->{webtailrc}, tail_opts => $opts->{'tail-opts'}; | |||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | get '/' => sub { shift->redirect_to('/webtail') }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 3 | app->start('daemon', @ARGV); | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | __END__ | ||||||||||||||||||||||||||||||||||||||||||