| 1 | package Taskwarrior::Kusarigama::Hook::OnLaunch; | ||
| 2 | 2 | our $AUTHORITY = 'cpan:YANICK'; | |
| 3 | #ABSTRACT: Role for plugins running during the task launch stage | ||
| 4 | 2 | $Taskwarrior::Kusarigama::Hook::OnLaunch::VERSION = '0.11.0'; | |
| 5 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 2 | requires 'on_launch'; | |
| 11 | |||
| 12 | 2 | 1; | |
| 13 | |||
| 14 | __END__ | ||
| 15 | |||
| 16 | =pod | ||
| 17 | |||
| 18 | =encoding UTF-8 | ||
| 19 | |||
| 20 | =head1 NAME | ||
| 21 | |||
| 22 | Taskwarrior::Kusarigama::Hook::OnLaunch - Role for plugins running during the task launch stage | ||
| 23 | |||
| 24 | =head1 VERSION | ||
| 25 | |||
| 26 | version 0.11.0 | ||
| 27 | |||
| 28 | =head1 SYNOPSIS | ||
| 29 | |||
| 30 | package Taskwarrior::Kusarigama::Plugin::Foo; | ||
| 31 | |||
| 32 | use Moo; | ||
| 33 | |||
| 34 | extends 'Taskwarrior::Kusarigama::Hook'; | ||
| 35 | |||
| 36 | with 'Taskwarrior::Kusarigama::Hook::OnLaunch'; | ||
| 37 | |||
| 38 | sub on_launch { | ||
| 39 | say "launching taskwarrior"; | ||
| 40 | } | ||
| 41 | |||
| 42 | 1; | ||
| 43 | |||
| 44 | =head1 DESCRIPTION | ||
| 45 | |||
| 46 | Role consumed by plugins running during the launching stage of | ||
| 47 | the Taskwarrior hook lifecycle. | ||
| 48 | |||
| 49 | Requires that a C<on_launch> is implemented. | ||
| 50 | |||
| 51 | The C<on_launch> method, when invoked, will be | ||
| 52 | given the list of tasks associated with the command. | ||
| 53 | |||
| 54 | sub on_launch { | ||
| 55 | my( $self, @tasks ) = @_; | ||
| 56 | |||
| 57 | ... | ||
| 58 | } | ||
| 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 | ||