| 1 | package Taskwarrior::Kusarigama::Plugin::Command::AndAfter; | ||||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||||
| 3 | # ABSTRACT: create a subsequent task | ||||||||||||
| 4 | 1 | $Taskwarrior::Kusarigama::Plugin::Command::AndAfter::VERSION = '0.10.0'; | |||||||||||
| 5 | |||||||||||||
| 6 | 1 | ▶ | use 5.10.0; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 1 | ▶ | use PerlX::Maybe; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | |||||||||||||
| 13 | 1 | ▶ | use Moo; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | 1 | extends 'Taskwarrior::Kusarigama::Plugin'; | |||||||||||
| 16 | |||||||||||||
| 17 | 1 | with 'Taskwarrior::Kusarigama::Hook::OnCommand'; | |||||||||||
| 18 | |||||||||||||
| 19 | sub on_command { | ||||||||||||
| 20 | 0 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
on_command: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||
| 21 | |||||||||||||
| 22 | 0 | ▶ | my( $previous ) = $self->run_task->export( [ | ||||||||||
|
Condition0%0/2
$self->pre_command_args || '+LATEST'
MC/DC0%0/1
$self->pre_command_args || '+LATEST'
$self->pre_command_args
Truth table0%0/2
A
A= $self->pre_command_args
| |||||||||||||
| 23 | $self->pre_command_args || '+LATEST' | ||||||||||||
| 24 | ]); | ||||||||||||
| 25 | |||||||||||||
| 26 | $self->run_task->add( { | ||||||||||||
| 27 | maybe project => $previous->{project}, | ||||||||||||
| 28 | depends => $previous->{uuid} | ||||||||||||
| 29 | 0 | }, $self->post_command_args ); | |||||||||||
| 30 | |||||||||||||
| 31 | 0 | say for $self->run_task->list( '+LATEST' ); | |||||||||||
| 32 | }; | ||||||||||||
| 33 | |||||||||||||
| 34 | 1 | 1; | |||||||||||
| 35 | |||||||||||||
| 36 | __END__ | ||||||||||||
| 37 | |||||||||||||
| 38 | =pod | ||||||||||||
| 39 | |||||||||||||
| 40 | =encoding UTF-8 | ||||||||||||
| 41 | |||||||||||||
| 42 | =head1 NAME | ||||||||||||
| 43 | |||||||||||||
| 44 | Taskwarrior::Kusarigama::Plugin::Command::AndAfter - create a subsequent task | ||||||||||||
| 45 | |||||||||||||
| 46 | =head1 VERSION | ||||||||||||
| 47 | |||||||||||||
| 48 | version 0.10.0 | ||||||||||||
| 49 | |||||||||||||
| 50 | =head1 SYNOPSIS | ||||||||||||
| 51 | |||||||||||||
| 52 | $ task 101 and-after do the next thing | ||||||||||||
| 53 | |||||||||||||
| 54 | =head1 DESCRIPTION | ||||||||||||
| 55 | |||||||||||||
| 56 | Creates a task that depends on the given task(s). If no previous task is | ||||||||||||
| 57 | provided, defaults to C<+LATEST>. If no project is explicitly given for the | ||||||||||||
| 58 | next task, it inherits the project of the previous task. | ||||||||||||
| 59 | |||||||||||||
| 60 | =head1 AUTHOR | ||||||||||||
| 61 | |||||||||||||
| 62 | Yanick Champoux <yanick@cpan.org> | ||||||||||||
| 63 | |||||||||||||
| 64 | =head1 COPYRIGHT AND LICENSE | ||||||||||||
| 65 | |||||||||||||
| 66 | This software is copyright (c) 2018, 2017 by Yanick Champoux. | ||||||||||||
| 67 | |||||||||||||
| 68 | This is free software; you can redistribute it and/or modify it under | ||||||||||||
| 69 | the same terms as the Perl 5 programming language system itself. | ||||||||||||
| 70 | |||||||||||||
| 71 | =cut | ||||||||||||