Aion

 view release on metacpan or  search on metacpan

i18n/Aion/Types.ru-en.po  view on Meta::CPAN


msgid "Определяет значение длины от `A` до `B` или от 0 до `A`, если `B` отсутствует."
msgstr "Specifies a length value from `A` to `B`, or from 0 to `A` if `B` is missing."

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 "Строка начинается с `S`."
msgstr "The line starts with `S`."

msgid "Строка заканчивается на `S`."
msgstr "The line ends with `S`."

msgid "Строка с одним или несколькими символами, не являющимися пробелами."
msgstr "A string containing one or more non-blank characters."

lib/Aion.pm  view on Meta::CPAN

		die $@ if $@;
	}
	
	goto &{"${cls}::new"};
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion - a postmodern object system for Perl 5, such as “Mouse”, “Moose”, “Moo”, “Mo” and “M”, but with improvements

=head1 VERSION

1.4

=head1 SYNOPSIS

lib/Aion/Meta/Feature.pm  view on Meta::CPAN

sub compare {
	my ($self, $other) = @_;
	
	die "Types mismatch: $other->{isa} <=> $self->{isa}" if $self->{isa} && $self->{isa} ne $other->{isa};
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Meta::Feature - feature metadescriptor

=head1 SYNOPSIS

	use Aion::Meta::Feature;
	
	our $feature = Aion::Meta::Feature->new("My::Package", "my_feature" => (is => 'rw'));

lib/Aion/Meta/FeatureConstruct.pm  view on Meta::CPAN

	s{(^\t*)|;[\t ]*(\S)}{
		if(defined $1) { $indent = $1 } else { ";\n$indent$2" }
	}gme;
	$_
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Meta::FeatureConstruct - accessor, predicate, initializer and clearer

=head1 SYNOPSIS

	use Aion::Meta::FeatureConstruct;
	
	our $construct = Aion::Meta::FeatureConstruct->new('My::Package', 'my_feature');

lib/Aion/Meta/RequiresAnyFunction.pm  view on Meta::CPAN

sub stringify {
	my ($self) = @_;

   	return "$self->{name} of $self->{pkg}";
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Meta::RequiresAnyFunction - defines any function that must be in the module

=head1 SYNOPSIS

	use Aion::Meta::RequiresAnyFunction;
	
	my $any_function = Aion::Meta::RequiresAnyFunction->new(

lib/Aion/Meta/RequiresFeature.pm  view on Meta::CPAN

		return "" if $value ne $other_value;
	}

	return 1;
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Meta::RequiresFeature - feature requirement for interfaces

=head1 SYNOPSIS

	use Aion::Types qw(Str);
	use Aion::Meta::RequiresFeature;
	use Aion::Meta::Feature;

lib/Aion/Meta/Subroutine.pm  view on Meta::CPAN


	my ($pkg, $subname) = @$self{qw/pkg subname/};
	my $signature = join " => ", @{$self->signature};
	return "$subname($signature) of $pkg";
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Meta::Subroutine - describes a function with a signature

=head1 SYNOPSIS

	use Aion::Types qw(Int);
	use Aion::Meta::Subroutine;
	

lib/Aion/Meta/Util.pm  view on Meta::CPAN

		$v = substr($v, 0, MAX_SCALAR_LENGTH) . '...'
			if length($v) > MAX_SCALAR_LENGTH;
		$no_str ? $v : "'${\ $v =~ s/['\\]/\\$&/gr }'"
	}
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Meta::Util - helper functions for creating meta data

=head1 SYNOPSIS

	package My::Meta::Class {
		use Aion::Meta::Util;
		

lib/Aion/Pleroma.pm  view on Meta::CPAN

# Файл с аннотациями
has ini => (is => 'ro', isa => Maybe[Str], default => INI);

# Конфигурация: ключ => класс#метод_класса
has pleroma => (is => 'ro', isa => HashRef[Str], default => sub {
	my ($self) = @_;
	
	my %pleroma = %{&PLEROMA};
	return \%pleroma unless defined $self->ini;
	
	open my $f, '<:utf8', INI or die "Not open ${\$self->ini}: $!";
	while(<$f>) {
		close($f), die "${\$self->ini} corrupt at line $.: $_" unless /^([\w:]+)#(\w*),\d+=(.*)$/;
		my ($pkg, $sub, $key) = ($1, $2, $3);
		my $action = join "#", $pkg, $sub || 'new';
		
		$key = $key ne ""? $key: ($sub? "$pkg#$sub": $pkg);
		
		close($f), die "The eon $key is $pleroma{$key}, but added other $action" if exists $pleroma{$key};
		
		$pleroma{$key} = $action;

lib/Aion/Pleroma.pm  view on Meta::CPAN

sub resolve {
	my ($self, $key) = @_;
	
	$self->get($key) // die "$key is'nt eon!"
}

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Pleroma - container of aeons

=head1 SYNOPSIS

	use Aion::Pleroma;
	
	my $pleroma = Aion::Pleroma->new;

lib/Aion/Type.pm  view on Meta::CPAN

	eval $code or die;

	$self
}


1;

__END__

=encoding utf-8

=head1 NAME

Aion::Type - class of validators

=head1 SYNOPSIS

	use Aion::Type;
	
	my $Int = Aion::Type->new(name => "Int", test => sub { /^-?\d+$/ });

lib/Aion/Types.md  view on Meta::CPAN

Строки, включая числа.

```perl
1.1 ~~ Str   # -> 1
"" ~~ Str    # -> 1
1.1.0 ~~ Str # -> ""
```

## Uni

Строки Unicode с флагом utf8 или если декодирование в utf8 происходит без ошибок.

```perl
"↭" ~~ Uni # -> 1
123 ~~ Uni # -> ""
do {no utf8; "↭" ~~ Uni} # -> 1
```

## Bin

Бинарные строки без флага utf8 и октетов с номерами меньше 128.

```perl
123 ~~ Bin # -> 1
"z" ~~ Bin # -> 1
"↭" ~~ Bin # -> ""
do {no utf8; "↭" ~~ Bin }   # -> ""
```

## StartsWith\[S]

Строка начинается с `S`.

```perl
"Hi, world!" ~~ StartsWith["Hi,"] # -> 1
"Hi world!" ~~ StartsWith["Hi,"] # -> ""
```

lib/Aion/Types.pm  view on Meta::CPAN

			my $m = overload::Method($_, '0+');
			Bool()->include($m ? $m->($_) : $_) };
		subtype "Enum[A...]", as &Item, where { $_ ~~ ARGS };
		subtype "Maybe[A]", as &Item, where { !defined($_) || A->test };
		subtype "Undef", as &Item, where { !defined $_ };
		subtype "Defined", as &Item, where { defined $_ };
			subtype "Value", as &Defined, where { "" eq ref $_ };
				subtype "Version", as &Value, where { "VSTRING" eq ref \$_ };
				my $init_limit = sub { if(@{&ARGS} == 1) { SELF->{min} = 0; SELF->{max} = A } else { SELF->{min} = A; SELF->{max} = B } };
				subtype "Str", as &Value, where { "SCALAR" eq ref \$_ };
					subtype "Uni", as &Str,	where { utf8::is_utf8($_) || /[\x80-\xFF]/a };
					subtype "Bin", as &Str, where { !utf8::is_utf8($_) && !/[\x80-\xFF]/a };
					subtype "NonEmptyStr", as &Str,	where { /\S/ };
					subtype "StartsWith[S]", as &Str,
						init_where { M = qr/^${\ quotemeta A}/ },
						where { $_ =~ M };
					subtype "EndsWith[S]", as &Str,
						init_where { N = qr/${\ quotemeta A}$/ },
						where { $_ =~ N };
					subtype "Email", as &Str, where { /@/ };
					subtype "Tel", as &Str, where { /^\+\d{7,}\z/ };
					subtype "Url", as &Str, where { /^https?:\/\// };

lib/Aion/Types.pm  view on Meta::CPAN

	coerce &Join, from &ArrayRef, via { join A, @$_ };
	
	subtype 'Split[S]', as &ArrayRef, where { 1 };
	coerce &Split, from &Str, via { [split A, $_] };
};

1;

__END__

=encoding utf-8

=head1 NAME

Aion::Types - a library of standard validators and it is used to create new validators

=head1 SYNOPSIS

	use Aion::Types;
	
	BEGIN {

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
	"z" ~~ Bin # -> 1
	"↭" ~~ Bin # -> ""
	do {no utf8; "↭" ~~ Bin }   # -> ""

=head2 StartsWith[S]

The line starts with C<S>.

	"Hi, world!" ~~ StartsWith["Hi,"] # -> 1
	"Hi world!" ~~ StartsWith["Hi,"] # -> ""

=head2 EndsWith[S]

t/aion.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion - постмодернистская объектная система для Perl 5, такая как «Mouse», «Moose», «Moo», «Mo» и «M», но с улучшениями
# 
# # VERSION
# 
# 1.3
# 
# # SYNOPSIS
# 

t/aion/meta/feature-construct.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Meta::FeatureConstruct - конструктор акцессора, предиката, инициализатора и очистителя
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Meta::FeatureConstruct;

our $construct = Aion::Meta::FeatureConstruct->new('My::Package', 'my_feature');

t/aion/meta/feature.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Meta::Feature - метаописатель фичи
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Meta::Feature;

our $feature = Aion::Meta::Feature->new("My::Package", "my_feature" => (is => 'rw'));

t/aion/meta/requires-any-function.pm  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  BEGIN {     $SIG{__DIE__} = sub ...
# 
# use common::sense;
# 
# use Aion::Meta::Util qw//;
# 
# Aion::Meta::Util::create_getters(qw/pkg name/);
# 
# sub new {
#     my $cls = shift;
#     bless {@_}, ref $cls || $cls;

t/aion/meta/requires-any-function.pm  view on Meta::CPAN

# sub compare {
#     my ($self, $other) = @_;
# 
#    	die "$self->{name} requires!" unless ref $other eq 'CODE';
# }
# 
# 1;
# 
# __END__
# 
# =encoding utf-8
# 
# =head1 NAME
# 
# Aion::Meta::RequiresAnyFunction - defines any function that must be in the module
# 
# =head1 SYNOPSIS
# 
# 	use Aion::Meta::RequiresAnyFunction;
# 	
# 	my $any_function = Aion::Meta::RequiresAnyFunction->new(

t/aion/meta/requires-any-function.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Meta::RequiresAnyFunction - определяет любую функцию, которая должна быть в модуле
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Meta::RequiresAnyFunction;

my $any_function = Aion::Meta::RequiresAnyFunction->new(

t/aion/meta/requires-feature.pm  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  BEGIN {     $SIG{__DIE__} = sub ...
# 
# use common::sense;
# 
# use Aion::Meta::Util qw//;
# use List::Util qw/pairmap/;
# use Scalar::Util qw/looks_like_number reftype blessed refaddr/;
# 
# Aion::Meta::Util::create_getters(qw/pkg name opt has/);
# 
# #  Конструктор

t/aion/meta/requires-feature.pm  view on Meta::CPAN

# 		return "" if $value ne $other_value;
# 	}
# 
# 	return 1;
# }
# 
# 1;
# 
# __END__
# 
# =encoding utf-8
# 
# =head1 NAME
# 
# Aion::Meta::RequiresFeature - требование фичи для интерфейсов
# 
# =head1 SYNOPSIS
# 
# 	use Aion::Types qw(Str);
# 	use Aion::Meta::RequiresFeature;
# 	use Aion::Meta::Feature;

t/aion/meta/requires-feature.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Meta::RequiresFeature - требование фичи для интерфейсов
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Types qw(Str);
use Aion::Meta::RequiresFeature;
use Aion::Meta::Feature;

t/aion/meta/subroutine.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Meta::Subroutine - описывает функцию с сигнатурой
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Types qw(Int);
use Aion::Meta::Subroutine;

t/aion/meta/util.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Meta::Util - вспомогательные функции для создания мета-данных
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
package My::Meta::Class {
	use Aion::Meta::Util;
	

t/aion/pleroma.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Pleroma - контейнер эонов
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Pleroma;

my $pleroma = Aion::Pleroma->new;

t/aion/type.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Type - класс валидаторов
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Type;

my $Int = Aion::Type->new(name => "Int", test => sub { /^-?\d+$/ });

t/aion/types.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Types - библиотека стандартных валидаторов и служит для создания новых валидаторов
# 
# # SYNOPSIS
# 
subtest 'SYNOPSIS' => sub { 
use Aion::Types;

BEGIN {

t/aion/types.t  view on Meta::CPAN

# Строки, включая числа.
# 
::done_testing; }; subtest 'Str' => sub { 
local ($::_g0 = do {1.1 ~~ Str}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '1.1 ~~ Str   # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"" ~~ Str}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"" ~~ Str    # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {1.1.0 ~~ Str}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '1.1.0 ~~ Str # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## Uni
# 
# Строки Unicode с флагом utf8 или если декодирование в utf8 происходит без ошибок.
# 
::done_testing; }; subtest 'Uni' => sub { 
local ($::_g0 = do {"↭" ~~ Uni}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"↭" ~~ Uni # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {123 ~~ Uni}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '123 ~~ Uni # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {do {no utf8; "↭" ~~ Uni}}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'do {no utf8; "↭" ~~ Uni} # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## Bin
# 
# Бинарные строки без флага utf8 и октетов с номерами меньше 128.
# 
::done_testing; }; subtest 'Bin' => sub { 
local ($::_g0 = do {123 ~~ Bin}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '123 ~~ Bin # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"z" ~~ Bin}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"z" ~~ Bin # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"↭" ~~ Bin}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"↭" ~~ Bin # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {do {no utf8; "↭" ~~ Bin }}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'do {no utf8; "↭" ~~ Bin }   # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;

# 
# ## StartsWith\[S]
# 
# Строка начинается с `S`.
# 
::done_testing; }; subtest 'StartsWith\[S]' => sub { 
local ($::_g0 = do {"Hi, world!" ~~ StartsWith["Hi,"]}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"Hi, world!" ~~ StartsWith["Hi,"] # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {"Hi world!" ~~ StartsWith["Hi,"]}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '"Hi world!" ~~ StartsWith["Hi,"] # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;



( run in 0.997 second using v1.01-cache-2.11-cpan-47059a37de6 )