line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Taskwarrior::Kusarigama::Plugin::ProjectAlias; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
3
|
|
|
|
|
|
|
#ABSTRACT: turn @foo into project:foo |
4
|
|
|
|
|
|
|
$Taskwarrior::Kusarigama::Plugin::ProjectAlias::VERSION = '0.12.0'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
147939
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
27
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
435
|
use Moo; |
|
1
|
|
|
|
|
9564
|
|
|
1
|
|
|
|
|
5
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends 'Taskwarrior::Kusarigama::Plugin'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Taskwarrior::Kusarigama::Hook::OnAdd'; |
14
|
|
|
|
|
|
|
with 'Taskwarrior::Kusarigama::Hook::OnModify'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub on_add { |
17
|
8
|
|
|
8
|
0
|
20810
|
my( $self, $task ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
8
|
|
|
|
|
16
|
my $desc = $task->{description}; |
20
|
|
|
|
|
|
|
|
21
|
8
|
50
|
|
|
|
83
|
$desc =~ s/(^|\s)\@(\w+)\s*/$1/ or return; |
22
|
|
|
|
|
|
|
|
23
|
8
|
|
|
|
|
24
|
$task->{project} = $2; |
24
|
|
|
|
|
|
|
|
25
|
8
|
|
|
|
|
18
|
$task->{description} = $desc; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub on_modify { |
29
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
$self->on_add(@_); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=pod |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=encoding UTF-8 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Taskwarrior::Kusarigama::Plugin::ProjectAlias - turn @foo into project:foo |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 VERSION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
version 0.12.0 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SYNOPSIS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$ task add do something @projectA |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Expands C<@foo> into C<project:foo>. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This software is copyright (c) 2019, 2018, 2017 by Yanick Champoux. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
66
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |