| 1 | package Luv::CLI::Command::List; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | # ABSTRACT: list current library dependencies | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use v5.38; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use Object::Pad; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use App::Cmd::Setup -command; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | ▶ | use Luv::CLI::Manifest; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 0 | ▶ | sub abstract { | ||||||||||||||||||
|
Subroutine
abstract: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 13 | 0 | "Lists the current dependencies."; | |||||||||||||||||||
| 14 | } | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 0 | ▶ | sub execute ( $self, $opt, $args ) { | ||||||||||||||||||
|
Subroutine
execute: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||
| 17 | 0 | my $manifest_path = "luv.json"; | |||||||||||||||||||
| 18 | 0 | ▶ | die "No luv.json found — run 'luv init' first\n" unless -e $manifest_path; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 0 | my $manifest = Luv::CLI::Manifest->new( path => $manifest_path ); | |||||||||||||||||||
| 21 | 0 | $manifest->load; | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | my $deps = $manifest->dependencies; | |||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 0 | ▶ | unless (%$deps) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 0 | print "No dependencies\n"; | |||||||||||||||||||
| 27 | 0 | return; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | for my $key ( sort keys %$deps ) { | |||||||||||||||||||
| 31 | 0 | my $dep = $deps->{$key}; | |||||||||||||||||||
| 32 | 0 | ▶ | my $name = $dep->{name} // $key; | ||||||||||||||||||
|
Condition0%0/3
$dep->{"name"} // $key
MC/DC0%0/2
$dep->{"name"} // $key
$dep->{"name"}
$key
Truth table0%0/3
A // B
A= $dep->{"name"}B= $key
| |||||||||||||||||||||
| 33 | 0 | print "$name\n"; | |||||||||||||||||||
| 34 | 0 | print " url: $dep->{url}\n"; | |||||||||||||||||||
| 35 | 0 | print " ref: $dep->{ref}\n"; | |||||||||||||||||||
| 36 | 0 | print " path: $dep->{path}\n"; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 0 | return; | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 1 | 1; | |||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||