App-Actions
view release on metacpan or search on metacpan
lib/App/Actions/Runner/Support.pm view on Meta::CPAN
C<runner.env_cycle>, not a partly filled-in value. To add to a variable
from an outer layer, give the new value another name.
=item * B<L</default_logger> does not filter by level.> It prints every
message it is given. To keep only some levels, or to write them to a file,
give the run a L<Log::Abstraction> logger of your own (see
L<App::Actions/new>).
=back
=head1 ENCODING
Environment names and values, step text and secrets are Perl character
strings and may contain any Unicode text, including non-ASCII characters
and emoji. L</write_container_file> writes the bytes it is given: encode
text (for example as UTF-8) before you pass it. Paths are used as bytes.
Action paths (C<./...>) should be ASCII, as on GitHub.
=head1 AUTHOR
Nigel Horne, C<njh@nigelhorne.com>
=head1 FORMAL SPECIFICATION
This section describes each routine in the Z notation, a precise
mathematical language for describing programs. You do not need to read it
to use the module: everything here is also said in plain words in the
sections above. It is for readers who want to check exactly what a routine
promises.
How to read it: a box names a routine. The lines above the middle rule
declare the values it works with. A name ending in C<?> is an input, and a
name ending in C<!> is an output. C<ÎState> means the routine changes
nothing, and C<ÎState> means it can change the state. The lines below the
rule are the conditions that are always true when the routine returns.
=head2 status_flags
ââ StatusFlags âââââââââââââââââââââââââââââââââââââ
â failed? : ð¹
â s! : {success, failure, cancelled} â ð¹
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â s!(success) = ¬ failed? â§ s!(failure) = failed? â§ s!(cancelled) = false
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 chomp_error
ââ ChompError ââââââââââââââââââââââââââââââââââââââ
â error? : VALUE
â s! : seq CHAR
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â s! = rtrim(string(error?))
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 default_logger
ââ DefaultLogger âââââââââââââââââââââââââââââââââââ
â logger! : LogAbstraction
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â â level : LEVEL; m : seq CHAR â¢
â logger!.log(level, m) â stderr' = stderr â m â â¨NEWLINEâ©
â logger!.history = â¨â©
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 null_logger
ââ NullLogger ââââââââââââââââââââââââââââââââââââââ
â logger! : LogAbstraction
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â â level : LEVEL; m : seq CHAR ⢠logger!.log(level, m) â stderr' = stderr
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 trim_error
ââ TrimError âââââââââââââââââââââââââââââââââââââââ
â error? : VALUE
â s! : optional seq CHAR
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â error? = ⥠⨠string(error?) = â¨â© â s! = â¥
â otherwise s! = Describe(error?)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 resolve_env
ââ ResolveEnv ââââââââââââââââââââââââââââââââââââââ
â layers? : seq (NAME ⸠VALUE)
â context? : CONTEXT
â env! : NAME ⸠seq CHAR
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â let merged == â/ layers?
â let refs == {a, b : dom merged | interpolating merged(a) reads env.b}
â (â n : dom merged ⢠(n, n) â refsâº) â raise runner.env_cycle
â otherwise env! = μ e ⢠{n : dom merged â¢
â n ⦠interpolate(merged(n), context? â {env ⦠e})}
â (each merged(n) is interpolated once; a result is never re-read)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 boolean_value
ââ BooleanValue ââââââââââââââââââââââââââââââââââââ
â value? : VALUE
â b! : ð¹
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â value? â REF â b! = truthy(value?)
â value? = ⥠⨠trim(value?) = â¨â© â b! = false
â trim(value?) â TRUE_WORD â b! = true
â trim(value?) â FALSE_WORD â b! = false
â otherwise b! = condition(trim(value?))
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 has_status_function
ââ HasStatusFunction âââââââââââââââââââââââââââââââ
â condition? : optional seq CHAR
â b! : ð¹
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â b! â condition? â ⥠⧠condition? contains f( for some f â STATUS
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 write_container_file
ââ WriteContainerFile ââââââââââââââââââââââââââââââ
â ÎFileSystem
â path?, contents? : seq CHAR
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â files' = files â {path? ⦠contents?}
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
=head2 local_action_path
( run in 1.241 second using v1.01-cache-2.11-cpan-60884a8df76 )