;
use Graph::Directed;
use List::AllUtils qw/ uniq first_value /;
use JSON;
my %tasks = map { $_->{uuid} => $_ } @{ from_json `task +PENDING export` };
my $graph = Graph::Directed->new;
$graph->a
re JSON;
my %filter = ( state => 'open' );
$filter{assignee} = $self->tw->config->{github}{user} unless $self->tw->config->{github}{user} eq $org;
my $user_filter = eval {
JSON::f
rom_json $self->tw->{config}{project}{$project}{filter}
};
%filter = ( %filter, %$user_filter ) if $user_filter;
say "syncing tickets for $org/$repo...";
my %tasks = map { $_->{gh_i
ady found locally";
say "fetching open tickets from Github...";
say "using filter ", JSON::to_json( \%filter );
my @issues = $self->github->issue->repos_issues(
$org, $repo, \%fi
use Path::Tiny;
use Hash::Merge qw/merge /;
use List::AllUtils qw/ reduce pairmap pairmap /;
use JSON;
use experimental 'postderef';
with 'Taskwarrior::Kusarigama::Core';
has raw_args => (
is
hod = join '_', 'run', $event;
my @plugins = $self->plugins->@*;
my @tasks = map { from_json($_) } <STDIN>;
try {
$self->$method(\@plugins,@tasks);
}
catch {
say
on_add($task) for grep { $_->DOES('Taskwarrior::Kusarigama::Hook::OnAdd') } @$plugins;
say to_json($task);
}
# TODO document the $old, $new, $diff
sub run_modify {
my( $self, $plugins, $old
my( $self, $task ) = @_;
require JSON;
my $id = $task->{uuid} || '+LATEST';
my $json = JSON::to_json([ $task ]);
$self->RUN('import', \$json );
my ( $new ) = $self->export($i
xport {
my( $self, @args ) = @_;
require JSON;
return map {
Taskwarrior::Kusarigama::Task->new( $self => $_ )
} JSON::from_json( join '', $self->RUN( export => @args ) )->@*;
::Plugin::ProjectDefaults::VERSION = '0.12.0';
use 5.10.0;
use strict;
use warnings;
use JSON qw/ from_json /;
use Hash::Merge qw/ merge /;
use Moo;
use MooseX::MungeHas;
extends 'Taskwarrior::Kus
strict;
use warnings;
use Path::Tiny;
use Moo::Role;
use MooseX::MungeHas;
use IPC::Run3;
use JSON;
use Module::Runtime qw/ use_module /;
use List::AllUtils qw/ uniq /;
use experimental 'postdere
task rc.recurrence=no rc.hooks=off export /, @query], undef, \my $out;
return eval { @{ from_json $out } };
}
sub new_task {
my ( $self, $task ) = @_;
$task ||= {};
return Taskwar
ew( $self->run_task, $task );
}
sub import_task {
my( $self, $task ) = @_;
my $in = to_json $task;
run3 [qw/ task rc.recurrence=no import /], \$in;
}
sub calc {
my( $self, @stuff