Exobrain/Agent/Action/SimpleBeeHabit.pm

filter: Statementstmt 47.0% 8 / 17 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod n/a totaltotal 41.3% 12 / 29 CC 3 SCAR 10.0
CC
3
Cov
38%
run
4.8
depends
4.3
__ANON__
2.0
CRAP 2.7
« Exobrain/Config.pm ↑ Summary Exobrain/Agent/Run.pm »
1 package Exobrain::Agent::Action::SimpleBeeHabit;
2 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 with 'Exobrain::Agent::Run';
6 with 'Exobrain::Agent::Depends';
7  
8 # ABSTRACT: Update HabitRPG events from Beeminder
9 our $VERSION = '1.08'; # VERSION
10  
11  
12 0 ▶method depends() {
Subroutine BEGIN: called CC=1 SCAR=4.1
Subroutine depends: not called CC=2 SCAR=14.6
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 0 0
13 0 return qw(Measurement::Beeminder Intent::HabitRPG);
14 }
15  
16 0 ▶method run() {
Subroutine BEGIN: called CC=1 SCAR=4.1
Subroutine run: not called CC=2 SCAR=15.7
Branch: 1 branch
BranchTrueFalseTotal
if scalar @_ > 0 0 0 0
17  
18 # Habits are in the config file in 'bmndr-id = hrpg-uuid' pairs
19 0 my $hrpg_tasks = $self->config;
20  
21 $self->exobrain->watch_loop(
22 class => 'Measurement::Beeminder',
23 0 ▶ filter => sub { $hrpg_tasks->{ $_->goal } },
Subroutine __ANON__: not called CC=1 SCAR=6.9
24 0 ▶ then => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 $self->exobrain->intent('HabitRPG',
26 0 task => $hrpg_tasks->{ $_->goal },
27 direction => 'up',
28 );
29 }
30 0 );
31 }
32  
33 1;
34  
35 __END__
« Exobrain/Config.pm ↑ Summary Exobrain/Agent/Run.pm »