checkoff 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/coverage/.last_run.json +1 -1
- data/lib/checkoff.rb +1 -0
- data/lib/checkoff/sections.rb +0 -6
- data/lib/checkoff/subtasks.rb +41 -0
- data/lib/checkoff/version.rb +1 -1
- data/metrics/bigfiles_high_water_mark +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a75e010929b7dcb752bf9cffd0f424039cb4c54da94e44af30a8b8627f13eefb
|
4
|
+
data.tar.gz: f2410a5287cf99a90f23ed7052a18f09553a652b87b575a2b665e7717c0193fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7f458362faa147dc0c6d6097b4c3e912ce73c9a5de729fdfedd61bb691b7f0825b35dbce99ad5e06e7b82a1945a576fde09455fb94655a4748995d251da62e2
|
7
|
+
data.tar.gz: 3e47840ed4da82d9859876773436ad678f44b02e9b8aa1de34ed7f2de6b0a1ea4cb4b25738c627bc2d7bca1de27ced995e9b57e6f6af3e52badf499bdf5f4cd5
|
data/coverage/.last_run.json
CHANGED
data/lib/checkoff.rb
CHANGED
data/lib/checkoff/sections.rb
CHANGED
@@ -94,12 +94,6 @@ module Checkoff
|
|
94
94
|
end
|
95
95
|
cache_method :section_task_names, SHORT_CACHE_TIME
|
96
96
|
|
97
|
-
# Returns all subtasks, including section headers
|
98
|
-
def raw_subtasks(task)
|
99
|
-
task.subtasks(projects.task_options)
|
100
|
-
end
|
101
|
-
cache_method :raw_subtasks, LONG_CACHE_TIME
|
102
|
-
|
103
97
|
def task_due?(task)
|
104
98
|
if task.due_at
|
105
99
|
Time.parse(task.due_at) <= time.now
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'forwardable'
|
4
|
+
|
5
|
+
module Checkoff
|
6
|
+
# Query different subtasks of Asana tasks
|
7
|
+
class Subtasks
|
8
|
+
MINUTE = 60
|
9
|
+
LONG_CACHE_TIME = MINUTE * 15
|
10
|
+
SHORT_CACHE_TIME = MINUTE * 5
|
11
|
+
|
12
|
+
extend Forwardable
|
13
|
+
|
14
|
+
def file_task_by_section(current_section, by_section, task)
|
15
|
+
if task.name =~ /:$/
|
16
|
+
current_section = task.name
|
17
|
+
by_section[current_section] = []
|
18
|
+
else
|
19
|
+
by_section[current_section] ||= []
|
20
|
+
by_section[current_section] << task
|
21
|
+
end
|
22
|
+
[current_section, by_section]
|
23
|
+
end
|
24
|
+
|
25
|
+
def by_section(tasks)
|
26
|
+
current_section = nil
|
27
|
+
by_section = {}
|
28
|
+
tasks.each do |task|
|
29
|
+
current_section, by_section = file_task_by_section(current_section,
|
30
|
+
by_section, task)
|
31
|
+
end
|
32
|
+
by_section
|
33
|
+
end
|
34
|
+
|
35
|
+
# Returns all subtasks, including section headers
|
36
|
+
def raw_subtasks(task)
|
37
|
+
task.subtasks(projects.task_options)
|
38
|
+
end
|
39
|
+
cache_method :raw_subtasks, LONG_CACHE_TIME
|
40
|
+
end
|
41
|
+
end
|
data/lib/checkoff/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
389
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- lib/checkoff/config_loader.rb
|
195
195
|
- lib/checkoff/projects.rb
|
196
196
|
- lib/checkoff/sections.rb
|
197
|
+
- lib/checkoff/subtasks.rb
|
197
198
|
- lib/checkoff/tasks.rb
|
198
199
|
- lib/checkoff/version.rb
|
199
200
|
- lib/checkoff/workspaces.rb
|