checkoff 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.envrc +2 -1
- data/Gemfile.lock +1 -1
- data/coverage/.last_run.json +1 -1
- data/lib/checkoff/my_tasks.rb +2 -2
- data/lib/checkoff/sections.rb +5 -5
- data/lib/checkoff/tasks.rb +10 -0
- data/lib/checkoff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 934e52a0b06388d6c1dbadb1ff9890cdf74da88f95d9350af04beba49d4021cd
|
|
4
|
+
data.tar.gz: 1f8780b895c7be869384afc71e7e1187d7e6594dd9139cc951d5330c46028929
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac4dd6171e0867c4209bdd8b3b1e166164ab69b633e283d3985b3054c5a32aa81a076f573034584cfeece30312ea909ce0643850b49e7c5d1436ff75a0bc8cc8
|
|
7
|
+
data.tar.gz: 14e79f6ffc230d038cbb514dca84a34465c4f6aab7052b98f6de25dc63b1f3ca1507ab4a1b108da48e918da0f19ac10657d24f3e94d5610881379d0aafca6f4d
|
data/.envrc
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
# shellcheck shell=bash
|
|
2
2
|
PATH_add bin
|
|
3
|
-
|
|
3
|
+
export ASANA__PERSONAL_ACCESS_TOKEN="op://Private/Asana access token - VLD read-write/token" ASANA__DEFAULT_ASSIGNEE_GID="op://Private/Asana access token - VLD read-write/default_workspace_gid"
|
|
4
|
+
direnv_load with-op op run --cache -- direnv dump
|
data/Gemfile.lock
CHANGED
data/coverage/.last_run.json
CHANGED
data/lib/checkoff/my_tasks.rb
CHANGED
|
@@ -23,9 +23,9 @@ module Checkoff
|
|
|
23
23
|
# Given a 'My Tasks' project object, pull all tasks, then provide
|
|
24
24
|
# a Hash of tasks with section name -> task list of the
|
|
25
25
|
# uncompleted tasks.
|
|
26
|
-
def tasks_by_section_for_my_tasks(project)
|
|
26
|
+
def tasks_by_section_for_my_tasks(project, extra_fields: [])
|
|
27
27
|
raw_tasks = projects.tasks_from_project(project,
|
|
28
|
-
extra_fields: ['assignee_section.name'])
|
|
28
|
+
extra_fields: extra_fields + ['assignee_section.name'])
|
|
29
29
|
active_tasks = projects.active_tasks(raw_tasks)
|
|
30
30
|
by_my_tasks_section(active_tasks)
|
|
31
31
|
end
|
data/lib/checkoff/sections.rb
CHANGED
|
@@ -38,12 +38,12 @@ module Checkoff
|
|
|
38
38
|
|
|
39
39
|
# Given a workspace name and project name, then provide a Hash of
|
|
40
40
|
# tasks with section name -> task list of the uncompleted tasks
|
|
41
|
-
def tasks_by_section(workspace_name, project_name)
|
|
41
|
+
def tasks_by_section(workspace_name, project_name, extra_fields: [])
|
|
42
42
|
project = project_or_raise(workspace_name, project_name)
|
|
43
43
|
if project_name == :my_tasks
|
|
44
|
-
my_tasks.tasks_by_section_for_my_tasks(project)
|
|
44
|
+
my_tasks.tasks_by_section_for_my_tasks(project, extra_fields: extra_fields)
|
|
45
45
|
else
|
|
46
|
-
tasks_by_section_for_project(project)
|
|
46
|
+
tasks_by_section_for_project(project, extra_fields: extra_fields)
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -87,9 +87,9 @@ module Checkoff
|
|
|
87
87
|
|
|
88
88
|
# Given a project object, pull all tasks, then provide a Hash of
|
|
89
89
|
# tasks with section name -> task list of the uncompleted tasks
|
|
90
|
-
def tasks_by_section_for_project(project)
|
|
90
|
+
def tasks_by_section_for_project(project, extra_fields: [])
|
|
91
91
|
# print("project: #{project}")
|
|
92
|
-
raw_tasks = projects.tasks_from_project(project)
|
|
92
|
+
raw_tasks = projects.tasks_from_project(project, extra_fields: extra_fields)
|
|
93
93
|
# print("raw_tasks[0]: #{raw_tasks[0]}")
|
|
94
94
|
active_tasks = projects.active_tasks(raw_tasks)
|
|
95
95
|
by_section(active_tasks, project.gid)
|
data/lib/checkoff/tasks.rb
CHANGED
|
@@ -85,6 +85,16 @@ module Checkoff
|
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def incomplete_dependencies?(task)
|
|
88
|
+
# Avoid a reundant fetch. Unfortunately, Ruby SDK allows
|
|
89
|
+
# dependencies to be fetched along with other attributes--but
|
|
90
|
+
# then doesn't use it and does another HTTP GET! At least this
|
|
91
|
+
# way we can skip the extra HTTP GET in the common case when
|
|
92
|
+
# there are no dependencies.
|
|
93
|
+
#
|
|
94
|
+
# https://github.com/Asana/ruby-asana/issues/125
|
|
95
|
+
already_fetched_dependencies = task.instance_variable_get(:@dependencies)
|
|
96
|
+
return false unless already_fetched_dependencies.nil? || already_fetched_dependencies.size.positive?
|
|
97
|
+
|
|
88
98
|
task.dependencies.any? do |parent_task_info|
|
|
89
99
|
parent_task_gid = parent_task_info.gid
|
|
90
100
|
parent_task = @asana_task.find_by_id(client, parent_task_gid,
|
data/lib/checkoff/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: checkoff
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.17.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vince Broz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|