NAME

Aion::Annotation - processes annotations in perl modules

VERSION

0.1.0

SYNOPSIS

File lib/For/Test.pm:

package For::Test;
# The package for testing
#@deprecated for_test

#@deprecated
#@todo add1
# Is property
#   readonly
has abc => (is => 'ro');

#@todo add2
#@param Int $a
#@param Int[] $r
sub xyz {}

1;



use Aion::Annotation;

Aion::Annotation->new->scan;

open my $f, '<', 'var/cache/modules.mtime.ini' or die $!; my @modules_mtime = <$f>; chop for @modules_mtime; close $f;
open my $f, '<', 'etc/annotation/remarks.ini' or die $!; my @remarks = <$f>; chop for @remarks; close $f;
open my $f, '<', 'etc/annotation/todo.ann' or die $!; my @todo = <$f>; chop for @todo; close $f;
open my $f, '<', 'etc/annotation/deprecated.ann' or die $!; my @deprecated = <$f>; chop for @deprecated; close $f;
open my $f, '<', 'etc/annotation/param.ann' or die $!; my @param = <$f>; chop for @param; close $f;

0+@modules_mtime  # -> 1
$modules_mtime[0] # ~> ^For::Test=\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$
\@remarks         # --> ['For::Test#,4=The package for testing', 'For::Test#abc,9=Is property\n  readonly']
\@todo            # --> ['For::Test#abc,6=add1', 'For::Test#xyz,11=add2']
\@deprecated      # --> ['For::Test#,3=for_test', 'For::Test#abc,5=']
\@param           # --> ['For::Test#xyz,12=Int $a', 'For::Test#xyz,13=Int[] $r']

DESCRIPTION

Aion::Annotation scans the perl modules in the lib directory and prints them to the corresponding files in the etc/annotation directory.

You can change lib through the AION_ANNOTATION_LIB environment, etc/annotation through the AION_ANNOTATION_INI config, and var/cache through the AION_ANNOTATION_CACHE config.

1. modules.mtime.ini stores the times of the last module update.
2. remarks.ini stores comments for routines, properties and packages.
3. The name.ann files save annotations by their names.

SUBROUTINES/METHODS

scan ()

Scans the codebase specified by the AION_ANNOTATION_LIB config (list of directories via :, default lib). And it takes out all the annotations and comments and prints them into the appropriate files in the AION_ANNOTATION_INI directory (default "etc/annotation").

AUTHOR

Yaroslav O. Kosmina mailto:dart@cpan.org

LICENSE

GPLv3

COPYRIGHT

The Aion::Annotation module is copyright © 2025 Yaroslav O. Kosmina. Rusland. All Rights Reserved.