view release on metacpan or search on metacpan
i18n/Aion/Env.ru-en.po view on Meta::CPAN
msgid "Файл .env:"
msgstr ".env file:"
msgid "РпÑоекÑаÑ
иÑполÑзÑеÑÑÑ ÐºÐ¾Ð½ÑигÑÑаÑионнÑй Ñайл `.env` Ð´Ð»Ñ ÐºÐ¾Ð½ÑигÑÑаÑии пÑоекÑа, в `Makefile`, Ð´Ð»Ñ `docker` и `docker compose`. ÐаннÑй модÑÐ»Ñ Ð¿Ð¾Ð·Ð²Ð¾Ð»ÑÐµÑ Ð¾Ñ...
msgstr "Projects use the `.env` configuration file for project configuration, in `Makefile`, for `docker` and `docker compose`. This module allows you to design environment variables as constants of `perl` modules."
msgid "ÐонÑÑанÑÑ Ð¸Ð½Ð¸ÑиализиÑÑÑÑÑÑ Ð¸Ð· `%ENV`, еÑли Ñам Ð½ÐµÑ Ð·Ð½Ð°ÑÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ оно `undef`, Ñо из Ñайла `.env`, а еÑли и Ñам его не бÑÐ´ÐµÑ â из опÑии `default`."
msgstr "Constants are initialized from `%ENV`, if there is no value there or it is `undef`, then from the `.env` file, and if it is not there, from the `default` option."
msgid "ÐÑи паÑÑинге Ñайла, оÑибка ÑинÑакÑиÑа пÑиведÑÑ Ðº иÑклÑÑениÑ."
msgstr "When parsing a file, a syntax error will result in an exception."
msgid "Тип пеÑеменной окÑÑÐ¶ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð¾ пÑовеÑÑÑÑ Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ Ð¾Ð¿Ñии `isa`."
msgstr "The type of an environment variable can be checked using the `isa` option."
msgid "РекомендÑеÑÑÑ Ð½Ð°Ð·ÑваÑÑ Ð¿ÐµÑеменнÑе окÑÑÐ¶ÐµÐ½Ð¸Ñ Ð¸ÑполÑзÑÑ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ðµ модÑÐ»Ñ Ð² коÑоÑом она обÑÑвлена. ÐапÑимеÑ, Ð¿Ð°ÐºÐµÑ `Aion::Type`, Ñогда имена ...
msgstr "It is recommended to name environment variables using the name of the module in which it is declared. For example, the package is `Aion::Type`, then the names of the environment variables in it are `AION_TYPE_*`."
msgid "СоздаÑÑ ÐºÐ¾Ð½ÑÑанÑÑ Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ `$name` в пакеÑе из коÑоÑого вÑзван.\n"
"ÐпÑионалÑно можно пеÑедаÑÑ Ð² `%kw` `isa` и `default`."
msgstr "Creates a constant with the name `$name` in the package from which it is called.\n"
i18n/Aion/Type.ru-en.po view on Meta::CPAN
msgid "ÐÑовеÑÑеÑ, ÑÑо аÑгÑÐ¼ÐµÐ½Ñ Ð½Ðµ пÑÐ¸Ð½Ð°Ð´Ð»ÐµÐ¶Ð¸Ñ ÐºÐ»Ð°ÑÑÑ."
msgstr "Checks that the argument does not belong to the class."
msgid "ÐÑивеÑÑи `$value` к ÑипÑ, еÑли пÑиведение из Ñипа и ÑÑнкÑии наÑ
одиÑÑÑ Ð² `$self->{coerce}`."
msgstr "Cast `$value` to type if the cast from type and function is in `$self->{coerce}`."
msgid "СооÑвеÑÑÑвÑÐµÑ Ð¾Ð¿ÐµÑаÑоÑÑ `>>`."
msgstr "Corresponds to the `>>` operator."
msgid "ФоÑмиÑÑÐµÑ ÑообÑение оÑибки."
msgstr "Generates an error message."
msgid "ÐÑовеÑÑÐµÑ `$element` и вÑбÑаÑÑÐ²Ð°ÐµÑ ÑообÑение `detail`, еÑли ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð½Ðµ пÑÐ¸Ð½Ð°Ð´Ð»ÐµÐ¶Ð¸Ñ ÐºÐ»Ð°ÑÑÑ."
msgstr "Checks `$element` and throws a `detail` message if the element does not belong to the class."
msgid "ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ `$val` в ÑÑÑокÑ."
msgstr "Converts `$val` to a string."
msgid "ÐпÑеделÑеÑ, ÑÑо Ñип ÑвлÑеÑÑÑ Ð¿Ð¾Ð´Ñипом дÑÑгого `$type` по имени Ñипа."
msgstr "Determines that a type is a subtype of another `$type` by type name."
i18n/Aion/Type.ru-en.po view on Meta::CPAN
msgid "СпиÑок аÑгÑменÑов."
msgstr "List of arguments."
msgid "ÐÐ¼Ñ Ñипа."
msgstr "Type name."
msgid "РодиÑелÑÑкий Ñип."
msgstr "Parent type."
msgid "ÐкÑеÑÑÐ¾Ñ ÑообÑениÑ. ÐÑполÑзÑÐµÑ `&message` Ð´Ð»Ñ Ð³ÐµÐ½ÐµÑаÑии ÑообÑÐµÐ½Ð¸Ñ Ð¾Ð± оÑибке."
msgstr "Message accessor. Uses `&message` to generate an error message."
msgid "ÐкÑеÑÑÐ¾Ñ Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²ÐºÐ° (иÑполÑзÑеÑÑÑ Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ ÑÑ
ÐµÐ¼Ñ **swagger**)."
msgstr "Header accessor (used to create the **swagger** schema)."
msgid "ÐкÑеÑÑÐ¾Ñ Ð¾Ð¿Ð¸ÑÐ°Ð½Ð¸Ñ (иÑполÑзÑеÑÑÑ Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ ÑÑ
ÐµÐ¼Ñ **swagger**)."
msgstr "Description accessor (used to create a **swagger** schema)."
msgid "ÐкÑеÑÑÐ¾Ñ Ð¿ÑимеÑа (иÑполÑзÑеÑÑÑ Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ ÑÑ
ÐµÐ¼Ñ **swagger**)."
msgstr "Example accessor (used to create the **swagger** schema)."
i18n/Aion/Types.ru-en.po view on Meta::CPAN
msgid "ЧеÑвÑÑÑÑй аÑгÑÐ¼ÐµÐ½Ñ Ñипа."
msgstr "The fourth type argument."
msgid "`M` и `N` ÑокÑаÑение Ð´Ð»Ñ `SELF->{M}` и `SELF->{N}`."
msgstr "`M` and `N` are shorthand for `SELF->{M}` and `SELF->{N}`."
msgid "СокÑаÑение Ð´Ð»Ñ `SELF->{N}`."
msgstr "Shorthand for `SELF->{N}`."
msgid "ÐÑполÑзÑеÑÑÑ Ñ `subtype` Ð´Ð»Ñ Ð²Ñвода ÑообÑÐµÐ½Ð¸Ñ Ð¾Ð± оÑибке, еÑли знаÑение иÑклÑÑÐ°ÐµÑ Ñип. Ð `$code` иÑполÑзÑеÑÑÑ: `SELF` - ÑекÑÑий Ñип, `ARGS`, `A`, `B`, `C`, `D...
msgstr "Used with `subtype` to print an error message if the value excludes the type. `$code` uses: `SELF` - the current type, `ARGS`, `A`, `B`, `C`, `D` - type arguments (if any) and a test value in `$_`. It can be converted to a string using `SELF-...
msgid "ÐобавлÑÐµÑ Ð½Ð¾Ð²Ð¾Ðµ пÑиведение (`$via`) к `$type` из `$from` Ñипа."
msgstr "Adds a new cast (`$via`) to `$type` from `$from` type."
msgid "ÐÐ¾Ð¶ÐµÑ Ð¸ÑполÑзоваÑÑ Ð¿Ð°ÑамеÑÑÑ Ñипа:"
msgstr "Can use parameters like:"
msgid "`coerce` вÑбÑаÑÑÐ²Ð°ÐµÑ Ð¸ÑклÑÑениÑ:"
msgstr "`coerce` throws exceptions:"
i18n/Aion/Types.ru-en.po view on Meta::CPAN
msgid "ÐпÑеделÑÐµÑ Ð·Ð½Ð°Ñение Ð´Ð»Ð¸Ð½Ñ Ð¾Ñ `from` или 0 до `to`."
msgstr "Specifies a length value from `from` or 0 to `to`."
msgid "Perl веÑÑии."
msgstr "Perl version."
msgid "СÑÑоки, вклÑÑÐ°Ñ ÑиÑла."
msgstr "Strings, including numbers."
msgid "СÑÑоки Unicode Ñ Ñлагом utf8 или еÑли декодиÑование в utf8 пÑоиÑÑ
Ð¾Ð´Ð¸Ñ Ð±ÐµÐ· оÑибок."
msgstr "Unicode strings with the utf8 flag or if decoding to utf8 occurs without errors."
msgid "ÐинаÑнÑе ÑÑÑоки без Ñлага utf8 и окÑеÑов Ñ Ð½Ð¾Ð¼ÐµÑами менÑÑе 128."
msgstr "Binary strings without the utf8 flag and octets with numbers less than 128."
msgid "СÑÑока наÑинаеÑÑÑ Ñ `begin`."
msgstr "The line starts with `begin`."
msgid "СÑÑока заканÑиваеÑÑÑ Ð½Ð° `end`."
msgstr "The line ends with `end`."
lib/Aion/Type.md view on Meta::CPAN
ÐÑли Ñказан `init` Ñо пÑи каждом иÑполÑзовании подпÑогÑÐ°Ð¼Ð¼Ñ Ð±ÑÐ´ÐµÑ ÑоздаваÑÑÑÑ Ñип и иниÑиализиÑоваÑÑÑÑ.
```perl
eval { Aion::Type->new(name=>"Rim", init => sub {...})->make(__PACKAGE__) }; $@ # ~> init_where won't work in Rim
```
ÐÑли подпÑогÑамма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ñоздана, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение.
```perl
eval { Aion::Type->new(name=>"Rim")->make }; $@ # ~> syntax error
```
## make_arg ($pkg)
Ð¡Ð¾Ð·Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿ÑогÑÐ°Ð¼Ð¼Ñ Ñ Ð°ÑгÑменÑами, коÑоÑÐ°Ñ Ð²Ð¾Ð·Ð²ÑаÑÐ°ÐµÑ Ñип.
```perl
BEGIN {
Aion::Type->new(name=>"Len", test => sub {
$Aion::Type::SELF->{args}[0] <= length($_) && length($_) <= $Aion::Type::SELF->{args}[1]
})->make_arg(__PACKAGE__, 1);
}
"IX" ~~ Len[2,2] # => 1
```
ÐÑли подпÑогÑамма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ñоздана, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение.
```perl
eval { Aion::Type->new(name=>"Rim")->make_arg }; $@ # ~> syntax error
```
## make_maybe_arg ($pkg)
Ð¡Ð¾Ð·Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿ÑогÑÐ°Ð¼Ð¼Ñ Ñ Ð°ÑгÑменÑами или без.
```perl
BEGIN {
Aion::Type->new(
name => "Enum123",
lib/Aion/Type.md view on Meta::CPAN
}
3 ~~ Enum123 # -> 1
3 ~~ Enum123[4,5,6] # -> ""
5 ~~ Enum123[4,5,6] # -> 1
```
ÐÑли подпÑогÑамма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ñоздана, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение.
```perl
eval { Aion::Type->new(name=>"Rim")->make_maybe_arg }; $@ # ~> syntax error
```
## args ()
СпиÑок аÑгÑменÑов.
## name ()
ÐÐ¼Ñ Ñипа.
lib/Aion/Type.pm view on Meta::CPAN
push @{$Int->{coerce}}, [$Bool, sub { 0+$_ }];
push @{$Int->{coerce}}, [$Num, sub { int($_+.5) }];
$Int->coerce(5.5) # => 6
$Int->coerce(undef) # => 0
$Int->coerce("abc") # => abc
=head2 detail ($element, $feature)
Generates an error message.
my $Int = Aion::Type->new(name => "Int");
$Int->detail(-5, "Feature car") # => Feature car must have the type Int. The it is -5!
my $Num = Aion::Type->new(name => "Num", message => sub {
"Error: $_ is'nt $Aion::Type::SELF->{property}!"
});
$Num->detail("x", "car") # => Error: x is'nt car!
lib/Aion/Type.pm view on Meta::CPAN
}
"IX" ~~ Rim # => 1
If C<init> is specified, then each time the subroutine is used, a type will be created and initialized.
eval { Aion::Type->new(name=>"Rim", init => sub {...})->make(__PACKAGE__) }; $@ # ~> init_where won't work in Rim
If the routine cannot be created, an exception is thrown.
eval { Aion::Type->new(name=>"Rim")->make }; $@ # ~> syntax error
=head2 make_arg ($pkg)
Creates a subroutine with arguments that returns a type.
BEGIN {
Aion::Type->new(name=>"Len", test => sub {
$Aion::Type::SELF->{args}[0] <= length($_) && length($_) <= $Aion::Type::SELF->{args}[1]
})->make_arg(__PACKAGE__, 1);
}
"IX" ~~ Len[2,2] # => 1
If the routine cannot be created, an exception is thrown.
eval { Aion::Type->new(name=>"Rim")->make_arg }; $@ # ~> syntax error
=head2 make_maybe_arg ($pkg)
Creates a subroutine with or without arguments.
BEGIN {
Aion::Type->new(
name => "Enum123",
test => sub { $_ ~~ [1,2,3] },
a_test => sub { $_ ~~ $Aion::Type::SELF->{args} },
)->make_maybe_arg(__PACKAGE__);
}
3 ~~ Enum123 # -> 1
3 ~~ Enum123[4,5,6] # -> ""
5 ~~ Enum123[4,5,6] # -> 1
If the routine cannot be created, an exception is thrown.
eval { Aion::Type->new(name=>"Rim")->make_maybe_arg }; $@ # ~> syntax error
=head2 args ()
List of arguments.
=head2 name ()
Type name.
=head2 as ()
Parent type.
=head2 message (;&message)
Message accessor. Uses C<&message> to generate an error message.
=head2 title (;$title)
Header accessor (used to create the B<swagger> schema).
=head2 description (;$description)
Description accessor (used to create a B<swagger> schema).
=head2 example (;$example)
lib/Aion/Types.pm view on Meta::CPAN
"Hi my dear!" ~~ BeginAndEnd["Hi,", "!"]; # -> ""
"" . BeginAndEnd["Hi,", "!"] # => BeginAndEnd['Hi,', '!']
=head2 N
Shorthand for C<< SELF-E<gt>{N} >>.
=head2 message ($code)
Used with C<subtype> to print an error message if the value excludes the type. C<$code> uses: C<SELF> - the current type, C<ARGS>, C<A>, C<B>, C<C>, C<D> - type arguments (if any) and a test value in C<$_>. It can be converted to a string using C<< S...
=head2 coerce ($type, from => $from, via => $via)
Adds a new cast (C<$via>) to C<$type> from C<$from> type.
BEGIN {
subtype Four => where {4 eq $_};
}
"4a" ~~ Four # -> ""
lib/Aion/Types.pm view on Meta::CPAN
=head2 Str
Strings, including numbers.
1.1 ~~ Str # -> 1
"" ~~ Str # -> 1
1.1.0 ~~ Str # -> ""
=head2 Uni
Unicode strings with the utf8 flag or if decoding to utf8 occurs without errors.
"â" ~~ Uni # -> 1
123 ~~ Uni # -> ""
do {no utf8; "â" ~~ Uni} # -> 1
=head2 Bin
Binary strings without the utf8 flag and octets with numbers less than 128.
123 ~~ Bin # -> 1
t/aion/type.t view on Meta::CPAN
#
# ÐÑли Ñказан `init` Ñо пÑи каждом иÑполÑзовании подпÑогÑÐ°Ð¼Ð¼Ñ Ð±ÑÐ´ÐµÑ ÑоздаваÑÑÑÑ Ñип и иниÑиализиÑоваÑÑÑÑ.
#
::like scalar do {eval { Aion::Type->new(name=>"Rim", init => sub {...})->make(__PACKAGE__) }; $@}, qr{init_where won't work in Rim}, 'eval { Aion::Type->new(name=>"Rim", init => sub {...})->make(__PACKAGE__) }; $@ # ~> init_where won\'t work in Rim'...
#
# ÐÑли подпÑогÑамма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ñоздана, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение.
#
::like scalar do {eval { Aion::Type->new(name=>"Rim")->make }; $@}, qr{syntax error}, 'eval { Aion::Type->new(name=>"Rim")->make }; $@ # ~> syntax error'; undef $::_g0; undef $::_e0;
#
# ## make_arg ($pkg)
#
# Ð¡Ð¾Ð·Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿ÑогÑÐ°Ð¼Ð¼Ñ Ñ Ð°ÑгÑменÑами, коÑоÑÐ°Ñ Ð²Ð¾Ð·Ð²ÑаÑÐ°ÐµÑ Ñип.
#
::done_testing; }; subtest 'make_arg ($pkg)' => sub {
BEGIN {
Aion::Type->new(name=>"Len", test => sub {
$Aion::Type::SELF->{args}[0] <= length($_) && length($_) <= $Aion::Type::SELF->{args}[1]
})->make_arg(__PACKAGE__, 1);
}
local ($::_g0 = do {"IX" ~~ Len[2,2]}, $::_e0 = "1"); ::ok $::_g0 eq $::_e0, '"IX" ~~ Len[2,2] # => 1' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
#
# ÐÑли подпÑогÑамма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ñоздана, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение.
#
::like scalar do {eval { Aion::Type->new(name=>"Rim")->make_arg }; $@}, qr{syntax error}, 'eval { Aion::Type->new(name=>"Rim")->make_arg }; $@ # ~> syntax error'; undef $::_g0; undef $::_e0;
#
# ## make_maybe_arg ($pkg)
#
# Ð¡Ð¾Ð·Ð´Ð°ÐµÑ Ð¿Ð¾Ð´Ð¿ÑогÑÐ°Ð¼Ð¼Ñ Ñ Ð°ÑгÑменÑами или без.
#
::done_testing; }; subtest 'make_maybe_arg ($pkg)' => sub {
BEGIN {
Aion::Type->new(
name => "Enum123",
t/aion/type.t view on Meta::CPAN
}
local ($::_g0 = do {3 ~~ Enum123}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '3 ~~ Enum123 # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {3 ~~ Enum123[4,5,6]}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '3 ~~ Enum123[4,5,6] # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {5 ~~ Enum123[4,5,6]}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '5 ~~ Enum123[4,5,6] # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
#
# ÐÑли подпÑогÑамма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ñоздана, Ñо вÑбÑаÑÑваеÑÑÑ Ð¸ÑклÑÑение.
#
::like scalar do {eval { Aion::Type->new(name=>"Rim")->make_maybe_arg }; $@}, qr{syntax error}, 'eval { Aion::Type->new(name=>"Rim")->make_maybe_arg }; $@ # ~> syntax error'; undef $::_g0; undef $::_e0;
#
# ## args ()
#
# СпиÑок аÑгÑменÑов.
#
# ## name ()
#
# ÐÐ¼Ñ Ñипа.
#