checkoff 0.226.0 → 0.228.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/checkoff.gemspec +1 -1
- data/lib/checkoff/attachments.rb +10 -10
- data/lib/checkoff/cli.rb +9 -9
- data/lib/checkoff/custom_fields.rb +3 -3
- data/lib/checkoff/events.rb +6 -6
- data/lib/checkoff/internal/asana_event_enrichment.rb +10 -10
- data/lib/checkoff/internal/asana_event_filter.rb +2 -2
- data/lib/checkoff/internal/project_selector_evaluator.rb +2 -2
- data/lib/checkoff/internal/project_timing.rb +1 -1
- data/lib/checkoff/internal/search_url/parser.rb +3 -3
- data/lib/checkoff/internal/search_url/simple_param_converter.rb +1 -1
- data/lib/checkoff/internal/section_selector_evaluator.rb +4 -4
- data/lib/checkoff/internal/selector_classes/project.rb +2 -2
- data/lib/checkoff/internal/selector_classes/task.rb +4 -4
- data/lib/checkoff/internal/selector_evaluator.rb +1 -1
- data/lib/checkoff/internal/task_hashes.rb +1 -1
- data/lib/checkoff/internal/task_selector_evaluator.rb +1 -1
- data/lib/checkoff/internal/task_timing.rb +1 -1
- data/lib/checkoff/my_tasks.rb +5 -5
- data/lib/checkoff/portfolios.rb +6 -6
- data/lib/checkoff/project_selectors.rb +8 -8
- data/lib/checkoff/projects.rb +13 -13
- data/lib/checkoff/resources.rb +6 -6
- data/lib/checkoff/section_selectors.rb +7 -7
- data/lib/checkoff/sections.rb +21 -21
- data/lib/checkoff/subtasks.rb +6 -6
- data/lib/checkoff/tags.rb +8 -8
- data/lib/checkoff/task_searches.rb +12 -12
- data/lib/checkoff/task_selectors.rb +11 -11
- data/lib/checkoff/tasks.rb +23 -23
- data/lib/checkoff/timelines.rb +6 -6
- data/lib/checkoff/version.rb +1 -1
- data/lib/checkoff/workspaces.rb +1 -1
- data/rbi/checkoff.rbi +2482 -49
- data/sig/checkoff.rbs +29 -9
- metadata +2 -2
@@ -20,17 +20,17 @@ module Checkoff
|
|
20
20
|
LONG_CACHE_TIME = MINUTE * 15
|
21
21
|
SHORT_CACHE_TIME = MINUTE
|
22
22
|
|
23
|
-
# @param config [Hash<Symbol, Object
|
23
|
+
# @param config [Hash<Symbol, Object>,Checkoff::Internal::EnvFallbackConfigLoader]
|
24
24
|
# @param workspaces [Checkoff::Workspaces]
|
25
25
|
# @param sections [Checkoff::Sections]
|
26
26
|
# @param custom_fields [Checkoff::CustomFields]
|
27
27
|
# @param clients [Checkoff::Clients]
|
28
28
|
# @param client [Asana::Client]
|
29
29
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
30
|
-
workspaces: Checkoff::Workspaces.new(config:
|
31
|
-
sections: Checkoff::Sections.new(config:
|
32
|
-
custom_fields: Checkoff::CustomFields.new(config:
|
33
|
-
clients: Checkoff::Clients.new(config:
|
30
|
+
workspaces: Checkoff::Workspaces.new(config:),
|
31
|
+
sections: Checkoff::Sections.new(config:),
|
32
|
+
custom_fields: Checkoff::CustomFields.new(config:),
|
33
|
+
clients: Checkoff::Clients.new(config:),
|
34
34
|
client: clients.client)
|
35
35
|
@workspaces = workspaces
|
36
36
|
@sections = sections
|
@@ -44,8 +44,8 @@ module Checkoff
|
|
44
44
|
# @return [Boolean]
|
45
45
|
def filter_via_section_selector(section, section_selector)
|
46
46
|
# @sg-ignore
|
47
|
-
evaluator = SectionSelectorEvaluator.new(section
|
48
|
-
client:
|
47
|
+
evaluator = SectionSelectorEvaluator.new(section:, sections:, custom_fields:,
|
48
|
+
client:)
|
49
49
|
evaluator.evaluate(section_selector)
|
50
50
|
end
|
51
51
|
|
data/lib/checkoff/sections.rb
CHANGED
@@ -40,16 +40,16 @@ module Checkoff
|
|
40
40
|
# @param workspaces [Checkoff::Workspaces]
|
41
41
|
# @param time [Class<Time>]
|
42
42
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
43
|
-
client: Checkoff::Clients.new(config:
|
44
|
-
projects: Checkoff::Projects.new(config
|
45
|
-
client:
|
46
|
-
workspaces: Checkoff::Workspaces.new(config
|
47
|
-
client:
|
43
|
+
client: Checkoff::Clients.new(config:).client,
|
44
|
+
projects: Checkoff::Projects.new(config:,
|
45
|
+
client:),
|
46
|
+
workspaces: Checkoff::Workspaces.new(config:,
|
47
|
+
client:),
|
48
48
|
time: Time)
|
49
49
|
@projects = projects
|
50
50
|
@workspaces = workspaces
|
51
51
|
@my_tasks = Checkoff::MyTasks
|
52
|
-
.new(config
|
52
|
+
.new(config:, projects:, client:)
|
53
53
|
@client = client
|
54
54
|
@time = time
|
55
55
|
end
|
@@ -62,7 +62,7 @@ module Checkoff
|
|
62
62
|
# @return [Enumerable<Asana::Resources::Section>]
|
63
63
|
def sections_or_raise(workspace_name, project_name, extra_fields: [])
|
64
64
|
project = project_or_raise(workspace_name, project_name)
|
65
|
-
sections_by_project_gid(project.gid, extra_fields:
|
65
|
+
sections_by_project_gid(project.gid, extra_fields:)
|
66
66
|
end
|
67
67
|
cache_method :sections_or_raise, SHORT_CACHE_TIME
|
68
68
|
|
@@ -73,8 +73,8 @@ module Checkoff
|
|
73
73
|
# @return [Enumerable<Asana::Resources::Section>]
|
74
74
|
def sections_by_project_gid(project_gid, extra_fields: [])
|
75
75
|
fields = (%w[name] + extra_fields).sort.uniq
|
76
|
-
client.sections.get_sections_for_project(project_gid
|
77
|
-
options: { fields:
|
76
|
+
client.sections.get_sections_for_project(project_gid:,
|
77
|
+
options: { fields: })
|
78
78
|
end
|
79
79
|
cache_method :sections_by_project_gid, SHORT_CACHE_TIME
|
80
80
|
|
@@ -94,9 +94,9 @@ module Checkoff
|
|
94
94
|
|
95
95
|
project = project_or_raise(workspace_name, project_name)
|
96
96
|
if project_name == :my_tasks
|
97
|
-
my_tasks.tasks_by_section_for_my_tasks(project, only_uncompleted
|
97
|
+
my_tasks.tasks_by_section_for_my_tasks(project, only_uncompleted:, extra_fields:)
|
98
98
|
else
|
99
|
-
tasks_by_section_for_project(project, only_uncompleted
|
99
|
+
tasks_by_section_for_project(project, only_uncompleted:, extra_fields:)
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -108,8 +108,8 @@ module Checkoff
|
|
108
108
|
def tasks_by_section_gid(section_gid,
|
109
109
|
only_uncompleted: true,
|
110
110
|
extra_fields: [])
|
111
|
-
options = projects.task_options(extra_fields
|
112
|
-
only_uncompleted:
|
111
|
+
options = projects.task_options(extra_fields:,
|
112
|
+
only_uncompleted:)
|
113
113
|
client.tasks.get_tasks(section: section_gid, **options)
|
114
114
|
end
|
115
115
|
|
@@ -126,8 +126,8 @@ module Checkoff
|
|
126
126
|
only_uncompleted: true,
|
127
127
|
extra_fields: [])
|
128
128
|
section = section_or_raise(workspace_name, project_name, section_name)
|
129
|
-
options = projects.task_options(extra_fields
|
130
|
-
only_uncompleted:
|
129
|
+
options = projects.task_options(extra_fields:,
|
130
|
+
only_uncompleted:)
|
131
131
|
# Note: 30 minute cache time on a raw Enumerable from SDK gives
|
132
132
|
# 'Your pagination token has expired' errors. So we go ahead
|
133
133
|
# and eagerly evaluate here so we can enjoy the cache.
|
@@ -157,7 +157,7 @@ module Checkoff
|
|
157
157
|
# @return [Asana::Resources::Section]
|
158
158
|
def section_or_raise(workspace_name, project_name, section_name, extra_section_fields: [])
|
159
159
|
s = section(workspace_name, project_name, section_name,
|
160
|
-
extra_section_fields:
|
160
|
+
extra_section_fields:)
|
161
161
|
if s.nil?
|
162
162
|
valid_sections = sections_or_raise(workspace_name, project_name,
|
163
163
|
extra_fields: extra_section_fields).map(&:name)
|
@@ -199,8 +199,8 @@ module Checkoff
|
|
199
199
|
# @return [Asana::Resources::Section, nil]
|
200
200
|
def section_by_gid(gid)
|
201
201
|
options = {}
|
202
|
-
Asana::Resources::Section.new(parse(client.get("/sections/#{gid}", options:
|
203
|
-
client:
|
202
|
+
Asana::Resources::Section.new(parse(client.get("/sections/#{gid}", options:)).first,
|
203
|
+
client:)
|
204
204
|
rescue Asana::Errors::NotFound => e
|
205
205
|
debug e
|
206
206
|
nil
|
@@ -254,8 +254,8 @@ module Checkoff
|
|
254
254
|
only_uncompleted: true,
|
255
255
|
extra_fields: [])
|
256
256
|
raw_tasks = projects.tasks_from_project(project,
|
257
|
-
only_uncompleted
|
258
|
-
extra_fields:
|
257
|
+
only_uncompleted:,
|
258
|
+
extra_fields:)
|
259
259
|
active_tasks = projects.active_tasks(raw_tasks)
|
260
260
|
by_section(active_tasks, project.gid)
|
261
261
|
end
|
@@ -267,7 +267,7 @@ module Checkoff
|
|
267
267
|
def by_section(tasks, project_gid)
|
268
268
|
by_section = {}
|
269
269
|
# @sg-ignore
|
270
|
-
sections = client.sections.get_sections_for_project(project_gid
|
270
|
+
sections = client.sections.get_sections_for_project(project_gid:,
|
271
271
|
options: { fields: ['name'] })
|
272
272
|
sections.each_entry { |section| by_section[section_key(section.name)] = [] }
|
273
273
|
tasks.each { |task| file_task_by_section(by_section, task, project_gid) }
|
data/lib/checkoff/subtasks.rb
CHANGED
@@ -17,12 +17,12 @@ module Checkoff
|
|
17
17
|
|
18
18
|
extend Forwardable
|
19
19
|
|
20
|
-
# @param config [Hash]
|
20
|
+
# @param config [Hash,Checkoff::Internal::EnvFallbackConfigLoader]
|
21
21
|
# @param projects [Checkoff::Projects]
|
22
22
|
# @param clients [Checkoff::Clients]
|
23
23
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
24
|
-
projects: Checkoff::Projects.new(config:
|
25
|
-
clients: Checkoff::Clients.new(config:
|
24
|
+
projects: Checkoff::Projects.new(config:),
|
25
|
+
clients: Checkoff::Clients.new(config:))
|
26
26
|
@projects = projects
|
27
27
|
@client = clients.client
|
28
28
|
end
|
@@ -75,11 +75,11 @@ module Checkoff
|
|
75
75
|
only_uncompleted: true)
|
76
76
|
# @type [Hash]
|
77
77
|
all_options = projects.task_options(extra_fields: extra_fields + %w[is_rendered_as_separator],
|
78
|
-
only_uncompleted:
|
78
|
+
only_uncompleted:)
|
79
79
|
options = all_options.fetch(:options, {})
|
80
|
-
client.tasks.get_subtasks_for_task(task_gid
|
80
|
+
client.tasks.get_subtasks_for_task(task_gid:,
|
81
81
|
# per_page: 100, # stub doesn't have this arg available
|
82
|
-
options:
|
82
|
+
options:)
|
83
83
|
end
|
84
84
|
cache_method :subtasks_by_gid, LONG_CACHE_TIME
|
85
85
|
|
data/lib/checkoff/tags.rb
CHANGED
@@ -30,10 +30,10 @@ module Checkoff
|
|
30
30
|
# @param projects [Checkoff::Projects]
|
31
31
|
# @param workspaces [Checkoff::Workspaces]
|
32
32
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
33
|
-
clients: Checkoff::Clients.new(config:
|
33
|
+
clients: Checkoff::Clients.new(config:),
|
34
34
|
client: clients.client,
|
35
|
-
projects: Checkoff::Projects.new(config
|
36
|
-
workspaces: Checkoff::Workspaces.new(config
|
35
|
+
projects: Checkoff::Projects.new(config:, client:),
|
36
|
+
workspaces: Checkoff::Workspaces.new(config:, client:))
|
37
37
|
@workspaces = T.let(workspaces, Checkoff::Workspaces)
|
38
38
|
@projects = T.let(projects, Checkoff::Projects)
|
39
39
|
@client = T.let(client, Asana::Client)
|
@@ -52,7 +52,7 @@ module Checkoff
|
|
52
52
|
tag_gid = tag.gid
|
53
53
|
|
54
54
|
tasks_by_tag_gid(workspace_name, tag_gid,
|
55
|
-
only_uncompleted
|
55
|
+
only_uncompleted:, extra_fields:)
|
56
56
|
end
|
57
57
|
|
58
58
|
# @param workspace_name [String]
|
@@ -62,13 +62,13 @@ module Checkoff
|
|
62
62
|
#
|
63
63
|
# @return [Enumerable<Asana::Resources::Task>]
|
64
64
|
def tasks_by_tag_gid(workspace_name, tag_gid, only_uncompleted: true, extra_fields: [])
|
65
|
-
options = projects.task_options(extra_fields
|
66
|
-
only_uncompleted:
|
65
|
+
options = projects.task_options(extra_fields:,
|
66
|
+
only_uncompleted:)
|
67
67
|
params = build_params(options)
|
68
68
|
Asana::Resources::Collection.new(parse(client.get("/tags/#{tag_gid}/tasks",
|
69
|
-
params
|
69
|
+
params:, options: options[:options])),
|
70
70
|
type: Asana::Resources::Task,
|
71
|
-
client:
|
71
|
+
client:)
|
72
72
|
end
|
73
73
|
|
74
74
|
# @param workspace_name [String]
|
@@ -33,7 +33,7 @@ module Checkoff
|
|
33
33
|
# @!parse
|
34
34
|
# extend CacheMethod::ClassMethods
|
35
35
|
|
36
|
-
# @param config [Hash<Symbol, Object
|
36
|
+
# @param config [Hash<Symbol, Object>,Checkoff::Internal::EnvFallbackConfigLoader]
|
37
37
|
# @param workspaces [Checkoff::Workspaces]
|
38
38
|
# @param task_selectors [Checkoff::TaskSelectors]
|
39
39
|
# @param projects [Checkoff::Projects]
|
@@ -42,10 +42,10 @@ module Checkoff
|
|
42
42
|
# @param search_url_parser [Checkoff::Internal::SearchUrl::Parser]
|
43
43
|
# @param asana_resources_collection_class [Class<Asana::Resources::Collection>]
|
44
44
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
45
|
-
workspaces: Checkoff::Workspaces.new(config:
|
46
|
-
task_selectors: Checkoff::TaskSelectors.new(config:
|
47
|
-
projects: Checkoff::Projects.new(config:
|
48
|
-
clients: Checkoff::Clients.new(config:
|
45
|
+
workspaces: Checkoff::Workspaces.new(config:),
|
46
|
+
task_selectors: Checkoff::TaskSelectors.new(config:),
|
47
|
+
projects: Checkoff::Projects.new(config:),
|
48
|
+
clients: Checkoff::Clients.new(config:),
|
49
49
|
client: clients.client,
|
50
50
|
search_url_parser: Checkoff::Internal::SearchUrl::Parser.new,
|
51
51
|
asana_resources_collection_class: Asana::Resources::Collection)
|
@@ -74,8 +74,8 @@ module Checkoff
|
|
74
74
|
# @sg-ignore
|
75
75
|
api_params, task_selector = @search_url_parser.convert_params(url)
|
76
76
|
debug { "Task search params: api_params=#{api_params}, task_selector=#{task_selector}" }
|
77
|
-
raw_task_search(api_params, workspace_gid: workspace.gid, task_selector
|
78
|
-
extra_fields:
|
77
|
+
raw_task_search(api_params, workspace_gid: workspace.gid, task_selector:,
|
78
|
+
extra_fields:)
|
79
79
|
end
|
80
80
|
cache_method :task_search, SHORT_CACHE_TIME
|
81
81
|
|
@@ -94,11 +94,11 @@ module Checkoff
|
|
94
94
|
workspace_gid:, extra_fields: [], task_selector: [],
|
95
95
|
fetch_all: true)
|
96
96
|
# @sg-ignore
|
97
|
-
tasks = api_task_search_request(api_params, workspace_gid
|
97
|
+
tasks = api_task_search_request(api_params, workspace_gid:, extra_fields:)
|
98
98
|
|
99
99
|
if fetch_all && tasks.count == 100
|
100
100
|
# @sg-ignore
|
101
|
-
tasks = iterated_raw_task_search(api_params, workspace_gid
|
101
|
+
tasks = iterated_raw_task_search(api_params, workspace_gid:, extra_fields:)
|
102
102
|
end
|
103
103
|
|
104
104
|
debug { "#{tasks.count} raw tasks returned" }
|
@@ -131,9 +131,9 @@ module Checkoff
|
|
131
131
|
options = calculate_api_options(extra_fields)
|
132
132
|
@asana_resources_collection_class.new(parse(client.get(path,
|
133
133
|
params: api_params,
|
134
|
-
options:
|
134
|
+
options:)),
|
135
135
|
type: Asana::Resources::Task,
|
136
|
-
client:
|
136
|
+
client:)
|
137
137
|
end
|
138
138
|
|
139
139
|
# Perform a search using the Asana Task Search API and use manual pagination to
|
@@ -171,7 +171,7 @@ module Checkoff
|
|
171
171
|
|
172
172
|
# @type [Array<Asana::Resources::Task>]
|
173
173
|
task_batch = raw_task_search(new_api_params,
|
174
|
-
workspace_gid
|
174
|
+
workspace_gid:, extra_fields: extra_fields + ['created_at'],
|
175
175
|
fetch_all: false).to_a
|
176
176
|
oldest = task_batch.to_a.last
|
177
177
|
|
@@ -21,18 +21,18 @@ module Checkoff
|
|
21
21
|
SHORT_CACHE_TIME = MINUTE
|
22
22
|
|
23
23
|
# @sg-ignore
|
24
|
-
# @param [Hash] config
|
24
|
+
# @param [Hash,Checkoff::Internal::EnvFallbackConfigLoader] config
|
25
25
|
# @param [Asana::Client] client
|
26
26
|
# @param [Checkoff::Tasks] tasks
|
27
27
|
# @param [Checkoff::Timelines] timelines
|
28
28
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
29
|
-
client: Checkoff::Clients.new(config:
|
30
|
-
tasks: Checkoff::Tasks.new(config
|
31
|
-
client:
|
32
|
-
timelines: Checkoff::Timelines.new(config
|
33
|
-
client:
|
34
|
-
custom_fields: Checkoff::CustomFields.new(config
|
35
|
-
client:
|
29
|
+
client: Checkoff::Clients.new(config:).client,
|
30
|
+
tasks: Checkoff::Tasks.new(config:,
|
31
|
+
client:),
|
32
|
+
timelines: Checkoff::Timelines.new(config:,
|
33
|
+
client:),
|
34
|
+
custom_fields: Checkoff::CustomFields.new(config:,
|
35
|
+
client:))
|
36
36
|
@config = config
|
37
37
|
@tasks = tasks
|
38
38
|
@timelines = timelines
|
@@ -44,8 +44,8 @@ module Checkoff
|
|
44
44
|
# task details. Examples: [:tag, 'foo'] [:not, [:tag, 'foo']] [:tag, 'foo']
|
45
45
|
# @return [Boolean]
|
46
46
|
def filter_via_task_selector(task, task_selector)
|
47
|
-
evaluator = TaskSelectorEvaluator.new(task
|
48
|
-
custom_fields:
|
47
|
+
evaluator = TaskSelectorEvaluator.new(task:, tasks:, timelines:,
|
48
|
+
custom_fields:)
|
49
49
|
evaluator.evaluate(task_selector)
|
50
50
|
end
|
51
51
|
|
@@ -89,7 +89,7 @@ module Checkoff
|
|
89
89
|
extra_fields = ['custom_fields']
|
90
90
|
projects = Checkoff::Projects.new
|
91
91
|
project = projects.project_or_raise(workspace_name, project_name)
|
92
|
-
raw_tasks = projects.tasks_from_project(project, extra_fields:
|
92
|
+
raw_tasks = projects.tasks_from_project(project, extra_fields:)
|
93
93
|
tasks = raw_tasks.filter { |task| task_selectors.filter_via_task_selector(task, task_selector) }
|
94
94
|
# avoid n+1 queries generating the full task formatting
|
95
95
|
puts JSON.pretty_generate(tasks.map(&:to_h))
|
data/lib/checkoff/tasks.rb
CHANGED
@@ -42,15 +42,15 @@ module Checkoff
|
|
42
42
|
# @param date_class [Class<Date>]
|
43
43
|
# @param asana_task [Class<Asana::Resources::Task>]
|
44
44
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
45
|
-
client: Checkoff::Clients.new(config:
|
46
|
-
workspaces: Checkoff::Workspaces.new(config
|
47
|
-
client:
|
48
|
-
sections: Checkoff::Sections.new(config
|
49
|
-
client:
|
50
|
-
portfolios: Checkoff::Portfolios.new(config
|
51
|
-
client:
|
52
|
-
custom_fields: Checkoff::CustomFields.new(config
|
53
|
-
client:
|
45
|
+
client: Checkoff::Clients.new(config:).client,
|
46
|
+
workspaces: Checkoff::Workspaces.new(config:,
|
47
|
+
client:),
|
48
|
+
sections: Checkoff::Sections.new(config:,
|
49
|
+
client:),
|
50
|
+
portfolios: Checkoff::Portfolios.new(config:,
|
51
|
+
client:),
|
52
|
+
custom_fields: Checkoff::CustomFields.new(config:,
|
53
|
+
client:),
|
54
54
|
time_class: Time,
|
55
55
|
date_class: Date,
|
56
56
|
asana_task: Asana::Resources::Task)
|
@@ -130,7 +130,7 @@ module Checkoff
|
|
130
130
|
end
|
131
131
|
return nil if task_gid.nil?
|
132
132
|
|
133
|
-
task_by_gid(task_gid, only_uncompleted
|
133
|
+
task_by_gid(task_gid, only_uncompleted:, extra_fields:)
|
134
134
|
end
|
135
135
|
cache_method :task, LONG_CACHE_TIME
|
136
136
|
|
@@ -145,7 +145,7 @@ module Checkoff
|
|
145
145
|
# @sg-ignore
|
146
146
|
t = tasks(workspace_name,
|
147
147
|
project_name,
|
148
|
-
section_name
|
148
|
+
section_name:,
|
149
149
|
only_uncompleted: false)
|
150
150
|
task_for_gid = t.find { |task| task.name == task_name }
|
151
151
|
task_for_gid&.gid
|
@@ -162,12 +162,12 @@ module Checkoff
|
|
162
162
|
def task_by_gid(task_gid,
|
163
163
|
extra_fields: [],
|
164
164
|
only_uncompleted: true)
|
165
|
-
all_options = projects.task_options(extra_fields
|
166
|
-
only_uncompleted:
|
165
|
+
all_options = projects.task_options(extra_fields:,
|
166
|
+
only_uncompleted:)
|
167
167
|
# @type [Hash]
|
168
168
|
options = all_options.fetch(:options, {})
|
169
169
|
options[:completed_since] = all_options[:completed_since] unless all_options[:completed_since].nil?
|
170
|
-
client.tasks.find_by_id(task_gid, options:
|
170
|
+
client.tasks.find_by_id(task_gid, options:)
|
171
171
|
rescue Asana::Errors::NotFound => e
|
172
172
|
debug e
|
173
173
|
nil
|
@@ -186,7 +186,7 @@ module Checkoff
|
|
186
186
|
assignee_gid: default_assignee_gid)
|
187
187
|
@asana_task.create(client,
|
188
188
|
assignee: assignee_gid,
|
189
|
-
workspace: workspace_gid, name:
|
189
|
+
workspace: workspace_gid, name:)
|
190
190
|
end
|
191
191
|
|
192
192
|
# Return user-accessible URL for a task
|
@@ -254,7 +254,7 @@ module Checkoff
|
|
254
254
|
|
255
255
|
dependent_tasks << dependent_task
|
256
256
|
dependent_tasks += all_dependent_tasks(dependent_task,
|
257
|
-
extra_task_fields:
|
257
|
+
extra_task_fields:)
|
258
258
|
end
|
259
259
|
dependent_tasks
|
260
260
|
end
|
@@ -281,7 +281,7 @@ module Checkoff
|
|
281
281
|
#
|
282
282
|
# @return [Asana::Resources::Task]
|
283
283
|
def h_to_task(task_data)
|
284
|
-
task_hashes.h_to_task(task_data, client:
|
284
|
+
task_hashes.h_to_task(task_data, client:)
|
285
285
|
end
|
286
286
|
|
287
287
|
# True if the task is in a project which is in the given portfolio
|
@@ -332,8 +332,8 @@ module Checkoff
|
|
332
332
|
# @return [Checkoff::Internal::TaskTiming]
|
333
333
|
def task_timing
|
334
334
|
@task_timing ||= Checkoff::Internal::TaskTiming.new(time_class: @time_class, date_class: @date_class,
|
335
|
-
client
|
336
|
-
custom_fields:
|
335
|
+
client:,
|
336
|
+
custom_fields:)
|
337
337
|
end
|
338
338
|
|
339
339
|
# @return [Checkoff::Internal::TaskHashes]
|
@@ -353,12 +353,12 @@ module Checkoff
|
|
353
353
|
if section_name == :unspecified
|
354
354
|
project = projects.project_or_raise(workspace_name, project_name)
|
355
355
|
projects.tasks_from_project(project,
|
356
|
-
only_uncompleted
|
357
|
-
extra_fields:
|
356
|
+
only_uncompleted:,
|
357
|
+
extra_fields:)
|
358
358
|
else
|
359
359
|
@sections.tasks(workspace_name, project_name, section_name,
|
360
|
-
only_uncompleted
|
361
|
-
extra_fields:
|
360
|
+
only_uncompleted:,
|
361
|
+
extra_fields:)
|
362
362
|
end
|
363
363
|
end
|
364
364
|
cache_method :tasks, SHORT_CACHE_TIME
|
data/lib/checkoff/timelines.rb
CHANGED
@@ -24,7 +24,7 @@ module Checkoff
|
|
24
24
|
LONG_CACHE_TIME = MINUTE * 15
|
25
25
|
SHORT_CACHE_TIME = MINUTE
|
26
26
|
|
27
|
-
# @param config [Hash]
|
27
|
+
# @param config [Hash,Checkoff::Internal::EnvFallbackConfigLoader]
|
28
28
|
# @param workspaces [Checkoff::Workspaces]
|
29
29
|
# @param sections [Checkoff::Sections]
|
30
30
|
# @param tasks [Checkoff::Tasks]
|
@@ -32,11 +32,11 @@ module Checkoff
|
|
32
32
|
# @param clients [Checkoff::Clients]
|
33
33
|
# @param client [Asana::Client]
|
34
34
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
35
|
-
workspaces: Checkoff::Workspaces.new(config:
|
36
|
-
sections: Checkoff::Sections.new(config:
|
37
|
-
tasks: Checkoff::Tasks.new(config:
|
38
|
-
portfolios: Checkoff::Portfolios.new(config:
|
39
|
-
clients: Checkoff::Clients.new(config:
|
35
|
+
workspaces: Checkoff::Workspaces.new(config:),
|
36
|
+
sections: Checkoff::Sections.new(config:),
|
37
|
+
tasks: Checkoff::Tasks.new(config:),
|
38
|
+
portfolios: Checkoff::Portfolios.new(config:),
|
39
|
+
clients: Checkoff::Clients.new(config:),
|
40
40
|
client: clients.client)
|
41
41
|
@workspaces = workspaces
|
42
42
|
@sections = sections
|
data/lib/checkoff/version.rb
CHANGED
data/lib/checkoff/workspaces.rb
CHANGED
@@ -26,7 +26,7 @@ module Checkoff
|
|
26
26
|
# @param client [Asana::Client]
|
27
27
|
# @param asana_workspace [Class<Asana::Resources::Workspace>]
|
28
28
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
29
|
-
client: Checkoff::Clients.new(config:
|
29
|
+
client: Checkoff::Clients.new(config:).client,
|
30
30
|
asana_workspace: Asana::Resources::Workspace)
|
31
31
|
@config = config
|
32
32
|
@client = client
|