File Coverage

blib/lib/Taskwarrior/Kusarigama/Hook/OnModify.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::OnModify;
2             our $AUTHORITY = 'cpan:YANICK';
3             #ABSTRACT: Role for plugins running during the task modification stage
4             $Taskwarrior::Kusarigama::Hook::OnModify::VERSION = '0.11.0';
5 2     2   1014 use strict;
  2         6  
  2         58  
6 2     2   11 use warnings;
  2         4  
  2         45  
7              
8 2     2   10 use Moo::Role;
  2         5  
  2         11  
9              
10             requires 'on_modify';
11              
12             1;
13              
14             __END__
15              
16             =pod
17              
18             =encoding UTF-8
19              
20             =head1 NAME
21              
22             Taskwarrior::Kusarigama::Hook::OnModify - Role for plugins running during the task modification 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::OnModify';
37              
38             sub on_modify {
39             say "modifying tasks";
40             }
41              
42             1;
43              
44             =head1 DESCRIPTION
45              
46             Role consumed by plugins running during the task modification stage of
47             the Taskwarrior hook lifecycle.
48              
49             Requires that a C<on_modify> is implemented.
50              
51             The C<on_modify> method, when invoked, will be
52             given the new version of the task, the previous version,
53             and the delta as calculated by
54             L<Hash::Diff>'s c<diff> function.
55              
56             sub on_modify {
57             my( $self, $new_task, $old_task, $diff ) = @_;
58              
59             ...
60             }
61              
62             =head1 AUTHOR
63              
64             Yanick Champoux <yanick@cpan.org>
65              
66             =head1 COPYRIGHT AND LICENSE
67              
68             This software is copyright (c) 2018, 2017 by Yanick Champoux.
69              
70             This is free software; you can redistribute it and/or modify it under
71             the same terms as the Perl 5 programming language system itself.
72              
73             =cut