Aion-Run
view release on metacpan or search on metacpan
lib/Aion/Run/RunsRun.pm view on Meta::CPAN
has mask => (is => "ro", isa => Maybe[Str], arg => 1);
#@run run:runs âList of scriptsâ
sub list {
my ($self) = @_;
my @runs = sort {
$a->{rubric} eq $b->{rubric}? ($a->{name} cmp $b->{name}): $a->{rubric} cmp $b->{rubric}
} grep { $_->{name} =~ $self->mask } values %{ Aion::Run::Runner->new->runs };
my $len = max map length $_->{name}, @runs;
for my $run (@runs) {
eval "require $run->{pkg}";
my $FEATURE = $Aion::META{$run->{pkg}}{feature};
my $ARG = {};
exists $_->{arg} and $ARG->{$_->{arg}} = $_ for values %$FEATURE;
my @features = sort { $a->{arg} =~ /^\d+$/ && $b->{arg} =~ /^\d+$/ ? $a->{arg} <=> $b->{arg}: $a->{arg} cmp $b->{arg} } values %$ARG;
$run->{args} = join " ", map {
my $argument = $_->{opt}{init_arg} // $_->{name};
my $x = $_->{arg} =~ /^\d+$/ ? $argument :
$_->{isa}{name} eq "Bool" ? $_->{arg} : "$_->{arg} $argument";
$_->{required} ? ($_->{isa}{name} eq "ArrayRef" ? "$x..." : $x) :
($_->{isa}{name} eq "ArrayRef" ? "[$x...]" : "[$x]")
} @features;
}
my $len2 = max map length $_->{args}, @runs;
my $rubric;
for(@runs) {
printcolor "#yellow%s#r\n", $rubric = $_->{rubric} if $rubric ne $_->{rubric};
printcolor " #green%-${len}s #{bold red}%-${len2}s #{bold black}%s#r\n", $_->{name}, $_->{args}, $_->{remark};
}
}
1;
t/aion/run.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::Run - ÑÐ¾Ð»Ñ Ð´Ð»Ñ ÐºÐ¾Ð½ÑолÑнÑÑ
команд
#
# # VERSION
#
# 0.0.2
#
# # SYNOPSIS
#
t/aion/run/run-run.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::Run::RunRun - вÑполнÑÐµÑ Perl-код и ÑаÑпеÑаÑÑÐ²Ð°ÐµÑ ÑезÑлÑÑÐ°Ñ Ð½Ð° STDOUT
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {
use Aion::Format qw/trappout np/;
use Aion::Run::RunRun;
t/aion/run/runner.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::Run::Runner - запÑÑÐºÐ°ÐµÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ Ð¾Ð¿Ð¸ÑаннÑÑ Ð°Ð½Ð½Ð¾ÑаÑией `#@run`
#
# # SYNOPSIS
#
# Файл etc/annotation/run.ann:
#@> etc/annotation/run.ann
#>> Aion::Run::RunRun#run,3=run:run âExecutes Perl code in the context of the current projectâ
#>> Aion::Run::RunsRun#list,5=run:runs âList of scriptsâ
t/aion/run/runs-run.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::Run::RunsRun - ÑпиÑок ÑкÑипÑов Ñ Ð°Ð½Ð½Ð¾ÑаÑией `#@run`
#
# # SYNOPSIS
#
# Файл etc/annotation/run.ann:
#@> etc/annotation/run.ann
#>> Aion::Run::RunRun#run,3=run:run âExecutes Perl code in the context of the current projectâ
#>> Aion::Run::RunsRun#list,5=run:runs âList of scriptsâ
( run in 1.643 second using v1.01-cache-2.11-cpan-140bd7fdf52 )