checkoff 0.16.1 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 935a2426ba2f1d83fd784c8db089c4bf1d47d1a46e7ba67e8cd75e8bd797ee7e
4
- data.tar.gz: 040062ba44ad30695289c383f2bf25f1cd7e9f0e0b0abf289de2c58118cc271e
3
+ metadata.gz: 934e52a0b06388d6c1dbadb1ff9890cdf74da88f95d9350af04beba49d4021cd
4
+ data.tar.gz: 1f8780b895c7be869384afc71e7e1187d7e6594dd9139cc951d5330c46028929
5
5
  SHA512:
6
- metadata.gz: b72f34b4a882d9299cddaa740a81399b8930009666dcac323dcd148954095a6f292a46ecc16829c8e129420f1335bd1e8c41453c7b4401991a15a6cae7a96b68
7
- data.tar.gz: 2d2c3fcdecf30aeedcfd718e84d874ff8596f078c2f0ae276459f0224e802a968d7c08234fe2b7d55a15261c4dcadabd5240f0c4a08a119849728a176738f688
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
- eval "$(with-op op-env sh -e ASANA__PERSONAL_ACCESS_TOKEN -e ASANA__DEFAULT_ASSIGNEE_GID)"
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
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.16.1)
15
+ checkoff (0.17.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "result": {
3
3
  "line": 99.78,
4
- "branch": 94.31
4
+ "branch": 93.33
5
5
  }
6
6
  }
@@ -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
@@ -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)
@@ -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,
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Checkoff
4
4
  # Version of library
5
- VERSION = '0.16.1'
5
+ VERSION = '0.17.0'
6
6
  end
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.16.1
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-04-26 00:00:00.000000000 Z
11
+ date: 2022-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport