Kusarigama/Plugin/SingleActive.pm

filter: Statementstmt 82.3% 14 / 17 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 70.8% 17 / 24 CC 2 SCAR 11.0
CC
2
Cov
74%
on_launch
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Kusarigama/Plugin/Command/Wait.pm ↑ Summary Kusarigama/Core.pm »
1 package Taskwarrior::Kusarigama::Plugin::SingleActive;
2 1 our $AUTHORITY = 'cpan:YANICK';
3 1 $Taskwarrior::Kusarigama::Plugin::SingleActive::VERSION = '0.10.0';
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 extends 'Taskwarrior::Kusarigama::Hook';
11  
12 1 with 'Taskwarrior::Kusarigama::Hook::OnLaunch';
13  
14 sub on_launch {
15 0 ▶ my $self = shift;
Subroutine on_launch: not called CC=2 SCAR=17.9
Pod undocumented
16  
17 0 ▶ return unless $self->command eq 'start';
Branch: 1 branch
BranchTrueFalseTotal
unless $self->command eq "start" 0 0 0
18  
19 0 system 'task', '+ACTIVE', '+PENDING', 'stop';
20 };
21  
22 1 1;
23  
24 __END__
25  
26 =pod
27  
28 =encoding UTF-8
29  
30 =head1 NAME
31  
32 Taskwarrior::Kusarigama::Plugin::SingleActive
33  
34 =head1 VERSION
35  
36 version 0.10.0
37  
38 =head1 DESCRIPTION
39  
40 Assures that only one task is active.
41  
42 Basically, runs
43  
44 task +ACTIVE +PENDING stop
45  
46 before any call to C<task start>.
47  
48 =head1 AUTHOR
49  
50 Yanick Champoux <yanick@cpan.org>
51  
52 =head1 COPYRIGHT AND LICENSE
53  
54 This software is copyright (c) 2018, 2017 by Yanick Champoux.
55  
56 This is free software; you can redistribute it and/or modify it under
57 the same terms as the Perl 5 programming language system itself.
58  
59 =cut
« Kusarigama/Plugin/Command/Wait.pm ↑ Summary Kusarigama/Core.pm »