checkoff 0.13.2 → 0.14.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/Gemfile.lock +1 -1
- data/coverage/.last_run.json +1 -1
- data/lib/checkoff/subtasks.rb +19 -5
- data/lib/checkoff/tasks.rb +5 -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: 8750481397466c5207deda9bf852bc119c9ca347bd61ef97bdd8bd8b945d12f2
|
4
|
+
data.tar.gz: c65a0b1e37ef29fce62dbfe7cbfa5e92bcbc16dd0f8ff9be3a230a93840ce975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e16e2aa1b336c7ef2213d19ea1301bd8c9c6c631957d58e063fdf6a3f278521ba77590aec15c661b4c6a908aa77fee7b9593551df9062edb3ce1c4a19c7cb46
|
7
|
+
data.tar.gz: 4dc5118ce5b1ef2a6eabf3e71ee494a05beed7c4135162200fbfc258147f81b62eaf218e9666a2132c04d1abb18d745a76c388fe058b5829de528b51dc2bf9ab
|
data/Gemfile.lock
CHANGED
data/coverage/.last_run.json
CHANGED
data/lib/checkoff/subtasks.rb
CHANGED
@@ -16,9 +16,12 @@ module Checkoff
|
|
16
16
|
@projects = projects
|
17
17
|
end
|
18
18
|
|
19
|
-
#
|
20
|
-
def
|
21
|
-
task
|
19
|
+
# True if all subtasks of the task are completed
|
20
|
+
def all_subtasks_completed?(task)
|
21
|
+
raw_subtasks = raw_subtasks(task)
|
22
|
+
active_subtasks = @projects.active_tasks(raw_subtasks)
|
23
|
+
# anything left should be a section
|
24
|
+
active_subtasks.all? { |subtask| subtask_section?(subtask) }
|
22
25
|
end
|
23
26
|
|
24
27
|
# pulls a Hash of subtasks broken out by section
|
@@ -34,9 +37,20 @@ module Checkoff
|
|
34
37
|
|
35
38
|
# Returns all subtasks, including section headers
|
36
39
|
def raw_subtasks(task)
|
37
|
-
|
40
|
+
task_options = projects.task_options
|
41
|
+
task_options[:options][:fields] << 'is_rendered_as_separator'
|
42
|
+
task.subtasks(task_options)
|
43
|
+
end
|
44
|
+
cache_method :raw_subtasks, SHORT_CACHE_TIME
|
45
|
+
|
46
|
+
# True if the subtask passed in represents a section in the subtasks
|
47
|
+
#
|
48
|
+
# Note: expect this to be removed in a future version, as Asana is
|
49
|
+
# expected to move to the new-style way of representing sections
|
50
|
+
# as memberships with a separate API within a task.
|
51
|
+
def subtask_section?(subtask)
|
52
|
+
subtask.is_rendered_as_separator
|
38
53
|
end
|
39
|
-
cache_method :raw_subtasks, LONG_CACHE_TIME
|
40
54
|
|
41
55
|
private
|
42
56
|
|
data/lib/checkoff/tasks.rb
CHANGED
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.14.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: 2021-08-
|
11
|
+
date: 2021-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|