| 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
| |||||||||||
| 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
| |||||||||||
| 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__ | ||||||||||