| 1 | package Clustericious::Command::configdump; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use 5.010001; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use Mojo::Base 'Clustericious::Command'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use Clustericious::Config; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | ▶ | use YAML::XS qw( Dump ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | # ABSTRACT: Dump a clustericious configuration | ||||||||||||
| 11 | 1 | our $VERSION = '1.29'; # VERSION | |||||||||||
| 12 | |||||||||||||
| 13 | |||||||||||||
| 14 | 1 | has description => <<EOT; | |||||||||||
| 15 | Dump clustericious configuration | ||||||||||||
| 16 | EOT | ||||||||||||
| 17 | |||||||||||||
| 18 | 1 | has usage => <<EOT; | |||||||||||
| 19 | usage $0: configdump [ app ] | ||||||||||||
| 20 | EOT | ||||||||||||
| 21 | |||||||||||||
| 22 | sub run | ||||||||||||
| 23 | 0 | ▶ | { | ||||||||||
|
Subroutine
run: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 24 | 0 | my($self, $name) = @_; | |||||||||||
| 25 | 0 | ▶ | my $app_name = $name // ref($self->app); | ||||||||||
|
Condition0%0/2
$name // ref $self->app
MC/DC0%0/1
$name // ref $self->app
$name
Truth table0%0/2
A
A= $name
| |||||||||||||
| 26 | |||||||||||||
| 27 | 0 | my $config = eval { | |||||||||||
| 28 | 0 | ▶ | Clustericious::Config->new($app_name, sub { | ||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||
| 29 | 0 | my($type, $name) = @_; | |||||||||||
| 30 | 0 | ▶ | if($type eq 'not_found') | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | { | ||||||||||||
| 32 | 0 | say STDERR "ERROR: unable to find $name"; | |||||||||||
| 33 | 0 | exit 2; | |||||||||||
| 34 | } | ||||||||||||
| 35 | }) | ||||||||||||
| 36 | 0 | }; | |||||||||||
| 37 | |||||||||||||
| 38 | 0 | ▶ | if(my $error = $@) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 39 | { | ||||||||||||
| 40 | 0 | say STDERR "ERROR: in syntax: $error"; | |||||||||||
| 41 | 0 | exit 2; | |||||||||||
| 42 | } | ||||||||||||
| 43 | else | ||||||||||||
| 44 | { | ||||||||||||
| 45 | 0 | print Dump({ %$config }); | |||||||||||
| 46 | } | ||||||||||||
| 47 | }; | ||||||||||||
| 48 | |||||||||||||
| 49 | 1 | 1; | |||||||||||
| 50 | |||||||||||||
| 51 | __END__ | ||||||||||||