| 1 | package CLI::Simple::Migrate; | ||||||||||
| 2 | |||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 11 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 11 | ▶ | use CLI::Simple::Constants qw(:booleans); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 11 | ▶ | use CLI::Simple::Helpers qw(:all); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 11 | ▶ | use CLI::Simple::Scaffold qw(_cmd_scaffold); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 11 | ▶ | use English qw(-no_match_vars); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 11 | ▶ | use parent qw(Exporter); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 11 | our @EXPORT_OK = qw(_cmd_migrate); | |||||||||
| 14 | |||||||||||
| 15 | ######################################################################## | ||||||||||
| 16 | 0 | ▶ | sub _cmd_migrate { | ||||||||
|
Subroutine
_cmd_migrate: not called CC=2 SCAR=17.9
| |||||||||||
| 17 | ######################################################################## | ||||||||||
| 18 | 0 | my ( $class, $commands, $option_specs ) = @_; | |||||||||
| 19 | |||||||||||
| 20 | # dump spec with role class names then scaffold | ||||||||||
| 21 | 0 | my $yaml = _generate_spec_yaml( $class, $commands, $option_specs, $TRUE ); | |||||||||
| 22 | 0 | my $spec_file = _spec_filename($class); | |||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | open my $fh, '>', $spec_file | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | or die "ERROR: could not write $spec_file: $OS_ERROR\n"; | ||||||||||
| 26 | 0 | print {$fh} $yaml; | |||||||||
| 27 | 0 | close $fh; | |||||||||
| 28 | |||||||||||
| 29 | 0 | printf {*STDOUT} "wrote %s\n", $spec_file; | |||||||||
| 30 | |||||||||||
| 31 | # now scaffold from the spec we just wrote | ||||||||||
| 32 | 0 | _cmd_scaffold( $class, $commands, $option_specs ); | |||||||||
| 33 | |||||||||||
| 34 | 0 | return $SUCCESS; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 11 | 1; | |||||||||