.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "App::Yath::Util 3pm" .TH App::Yath::Util 3pm "2023-03-12" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" App::Yath::Util \- General utilities for yath that do not fit anywhere else. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This package exports several tools used throughout yath that did not fit into any other package. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 8 \& use App::Yath::Util qw{ \& find_pfile \& find_in_updir \& is_generated_test_pl \& fit_to_width \& isolate_stdout \& find_yath \& }; .Ve .SH "EXPORTS" .IX Header "EXPORTS" Note that nothing is exported by default, you must request each function to import. .ie n .IP "$path_to_pfile = find_pfile($settings, %params)" 4 .el .IP "\f(CW$path_to_pfile\fR = find_pfile($settings, \f(CW%params\fR)" 4 .IX Item "$path_to_pfile = find_pfile($settings, %params)" The first argument must be an instance of Test2::Harness::Settings. .Sp Currently the only supported param is \f(CW\*(C`vivify\*(C'\fR, when set to true the pfile will be created if one does not already exist. .Sp The pfile is a file that tells yath that a persistent runner is active, and how to communicate with it. .ie n .IP "$path_to_file = find_in_updir($file_name)" 4 .el .IP "\f(CW$path_to_file\fR = find_in_updir($file_name)" 4 .IX Item "$path_to_file = find_in_updir($file_name)" Look for \f(CW$file_name\fR in the current directory or any parent directory. .ie n .IP "$bool = is_generated_test_pl($path_to_test_file)" 4 .el .IP "\f(CW$bool\fR = is_generated_test_pl($path_to_test_file)" 4 .IX Item "$bool = is_generated_test_pl($path_to_test_file)" Check if the specified test file was generated by the \f(CW\*(C`yath init\*(C'\fR command. .ie n .IP "fit_to_width($width, $join, $text)" 4 .el .IP "fit_to_width($width, \f(CW$join\fR, \f(CW$text\fR)" 4 .IX Item "fit_to_width($width, $join, $text)" This will split the \f(CW$text\fR on space, and then recombine it using \f(CW$join\fR inserting newlines as necessary in an attempt to fit the text into \f(CW$width\fR horizontal characters. If any words are larger than \f(CW$width\fR they will not be split and text-wrapping may occur if used for terminal display. .ie n .IP "$stdout = \fBisolate_stdout()\fR" 4 .el .IP "\f(CW$stdout\fR = \fBisolate_stdout()\fR" 4 .IX Item "$stdout = isolate_stdout()" This will close \s-1STDOUT\s0 and reopen it to point at \s-1STDERR.\s0 The result of this is that any print statement that does not specify a fielhandle will print to \&\s-1STDERR\s0 instead of \s-1STDOUT,\s0 in addition any print directly to \s-1STDOUT\s0 will instead go to \s-1STDERR. A\s0 filehandle to the real \s-1STDOUT\s0 is returned for you to use when you actually want to write to \s-1STDOUT.\s0 .Sp This is used by some yath processes that need to print structured data to \&\s-1STDOUT\s0 without letting any third part modules they may load write to the real \&\s-1STDOUT.\s0 .ie n .IP "$path_to_script = \fBfind_yath()\fR" 4 .el .IP "\f(CW$path_to_script\fR = \fBfind_yath()\fR" 4 .IX Item "$path_to_script = find_yath()" This will attempt to find the \f(CW\*(C`yath\*(C'\fR command line script. When possible this will return the path that was used to launch yath. If yath was not run to start the process it will search the paths specified in the Config module. This will throw an exception if the script cannot be found. .Sp Note: The result is cached so that subsequent calls will return the same path even if something installs a new yath script in another location that would otherwise be found first. This guarentees that a single process will not switch scripts. .SH "SOURCE" .IX Header "SOURCE" The source code repository for Test2\-Harness can be found at \&\fIhttp://github.com/Test\-More/Test2\-Harness/\fR. .SH "MAINTAINERS" .IX Header "MAINTAINERS" .IP "Chad Granum " 4 .IX Item "Chad Granum " .SH "AUTHORS" .IX Header "AUTHORS" .PD 0 .IP "Chad Granum " 4 .IX Item "Chad Granum " .PD .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2020 Chad Granum . .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See \fIhttp://dev.perl.org/licenses/\fR