App-Multigit

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        use curry;
        my $future = App::Multigit::each(sub {
            my $repo = shift;
            $repo
                ->run([qw{git rebase origin/master}])
                ->else([qw{git rebase --abort])
                ->then($repo->curry::report)
            ;
        });

    The failure is thrown in a manner that conforms to the expected Future
    fail interface, i.e. there is an error message and an error code in
    there. Following these is the %data hash that is consistent to all
    invocations of run. That means that when you do else, you should be
    aware that there will be two extra parameters at the start of the
    argument list.

        use curry;
        my $future = App::Multigit::each(sub {
            my $repo = shift;
            $repo

lib/App/Multigit.pm  view on Meta::CPAN

    use curry;
    my $future = App::Multigit::each(sub {
        my $repo = shift;
        $repo
            ->run([qw{git rebase origin/master}])
            ->else([qw{git rebase --abort])
            ->then($repo->curry::report)
        ;
    });

The failure is thrown in a manner that conforms to the expected Future fail
interface, i.e. there is an error message and an error code in there. Following
these is the C<%data> hash that is consistent to all invocations of C<run>. That
means that when you do C<else>, you should be aware that there will be two extra
parameters at the start of the argument list.

    use curry;
    my $future = App::Multigit::each(sub {
        my $repo = shift;
        $repo
            ->run([qw{git rebase origin/master}])

lib/App/Multigit/Repo.pm  view on Meta::CPAN

of C<%data>. The CODE reference should use normal print/say/warn/die behaviour.
Its return value is discarded. If the subref returns at all, it is considered to
have succeeded.

If it is an ARRAY ref, it is run with IO::Async::Process, with C<stdout> sent
to the process's STDIN.

A Future object is returned. When the command finishes, the Future is completed
with a hash-shaped list identical to the one C<run> accepts.

If an error occurs I<before> running the command (i.e. if IO::Async throws the
error), it will behave as though an error occurred within the command, and
C<exitcode> will be set to 255.

=head3 data

C<run> accepts a hash of data. If C<stdout> or C<stderr> are provided here, the
Future will have these values in C<past_stdout> and C<past_stderr>, and
C<stdout> and C<stderr> will get populated with the I<new> STDOUT and STDERR
from the provided C<$command>.



( run in 0.269 second using v1.01-cache-2.11-cpan-496ff517765 )