File Coverage

blib/lib/Taskwarrior/Kusarigama/Hook/OnAdd.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Taskwarrior::Kusarigama::Hook::OnAdd;
2             our $AUTHORITY = 'cpan:YANICK';
3             #ABSTRACT: Role for plugins running during the task creation stage
4             $Taskwarrior::Kusarigama::Hook::OnAdd::VERSION = '0.12.0';
5              
6 4     4   1993 use strict;
  4         9  
  4         104  
7 4     4   17 use warnings;
  4         10  
  4         88  
8              
9 4     4   17 use Moo::Role;
  4         9  
  4         23  
10              
11             requires 'on_add';
12              
13             1;
14              
15             __END__
16              
17             =pod
18              
19             =encoding UTF-8
20              
21             =head1 NAME
22              
23             Taskwarrior::Kusarigama::Hook::OnAdd - Role for plugins running during the task creation stage
24              
25             =head1 VERSION
26              
27             version 0.12.0
28              
29             =head1 SYNOPSIS
30              
31             package Taskwarrior::Kusarigama::Plugin::Foo;
32              
33             use Moo;
34              
35             extends 'Taskwarrior::Kusarigama::Hook';
36              
37             with 'Taskwarrior::Kusarigama::Hook::OnAdd';
38              
39             sub on_add {
40             say "adding task";
41             }
42              
43             1;
44              
45             =head1 DESCRIPTION
46              
47             Role consumed by plugins running during the task creation stage of
48             the Taskwarrior hook lifecycle.
49              
50             Requires that a C<on_add> is implemented.
51              
52             The C<on_add> method, when invoked, will be
53             given the newly created task associated with the command.
54              
55             sub on_add {
56             my( $self, $task ) = @_;
57              
58             ...
59             }
60              
61             =head1 AUTHOR
62              
63             Yanick Champoux <yanick@cpan.org>
64              
65             =head1 COPYRIGHT AND LICENSE
66              
67             This software is copyright (c) 2019, 2018, 2017 by Yanick Champoux.
68              
69             This is free software; you can redistribute it and/or modify it under
70             the same terms as the Perl 5 programming language system itself.
71              
72             =cut