NAME

oEdtk::libDev - helpers for running an application in the development environment

SYNOPSIS

use oEdtk::libDev;

run_Edtk_dev();

DESCRIPTION

Development-run helpers: check the EDTK_DIR directory tree, prepare the input data, launch the composition in a development environment, and the small string helpers used along the way (unique identifiers, longest and shortest token, space removal).

FUNCTIONS

$NOK

The conventional "not OK" return code, -1.

run_Edtk_dev

run_Edtk_dev();

Run an application in the development environment: load the configuration, check the directory tree, prepare the data and launch the composition, with the start and stop screens.

IdUniqueSur7

IdUniqueSur7(\$id);

Make $id unique over seven characters: the first six characters are taken, and on a clash the first four followed by a three-digit counter are used, falling back to the first three characters padded with a letter. The optional second argument is a reference to the counter to seed.

lastLong

my $token = lastLong($string);

Return the longest token of $string, where tokens are separated by spaces, underscores or hyphens.

lastCourt

my $token = lastCourt($string);

Return the shortest token of $string, with the same separators as "lastLong".

delSp

my $count = delSp($string);

Remove every space from $string, in place, and return the number of characters removed.

check_EDTK_DIR

check_EDTK_DIR();

Expand every EDTK_DIR environment variable and create the matching directory tree.

wait_Enter

wait_Enter();

Print a pause prompt and wait for the enter key.

tree_Directory_Completion

tree_Directory_Completion($path);

Create, if needed, every directory of $path.

clean_full_dir

clean_full_dir($dir, $option);

Recursively delete the files under $dir. With --dry-run nothing is removed; with --verbose each deletion is reported.

file_list

my @files = file_list($dir, $pattern, $option);

Recursively collect the files under $dir whose path matches $pattern.

prep_Edtk_Data

my $ok = prep_Edtk_Data($input, $output, $option);

Trigger the data-extraction step of the current application; return $NOK on failure.

The deprecated IdUniqueSur6 sub is kept only for reference and is not part of the public API.

AUTHOR

The oEdtk team.