checkoff 0.169.0 → 0.170.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/checkoff/internal/asana_event_filter.rb +24 -2
- data/lib/checkoff/tasks.rb +1 -1
- 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: e346e26787afb1656a88445f35f22cd18c88519080b6224d4dcb83074149696f
|
4
|
+
data.tar.gz: f33d96167e8036964aee3eaa9a69e8b3e81c31a4e9fcec314ece54defe375b83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abf2f44932128fdfdf7d89e162431d4e4cfa89029bd106adb3b49ad6cc801e5b41838249595cf1f7dab8d25d3d52dcc1a2114be1f8f4a821dead7b9dcaf2fb71
|
7
|
+
data.tar.gz: 3828a170cdaa9cdd0f82beb5830dc2392a87a69bb45bff4f54d06865a6acde7a9962379c94435f03d3774450e6f4939ef282bd8e8922b4360d8162d809630b13
|
data/Gemfile.lock
CHANGED
@@ -7,7 +7,7 @@ module Checkoff
|
|
7
7
|
# Uses an enhanced version of Asana event filter configuration
|
8
8
|
#
|
9
9
|
# See https://developers.asana.com/reference/createwebhook | body
|
10
|
-
# params | data | filters for a general description of the scheme.
|
10
|
+
# params | data | filters | add object for a general description of the scheme.
|
11
11
|
#
|
12
12
|
# Additional supported filter keys:
|
13
13
|
#
|
@@ -17,8 +17,11 @@ module Checkoff
|
|
17
17
|
include Logging
|
18
18
|
|
19
19
|
# @param filters [Array<Hash>, nil] The filters to match against
|
20
|
-
|
20
|
+
# @param tasks [Checkoff::Tasks]
|
21
|
+
def initialize(filters:,
|
22
|
+
tasks: Checkoff::Tasks.new)
|
21
23
|
@filters = filters
|
24
|
+
@tasks = tasks
|
22
25
|
end
|
23
26
|
|
24
27
|
# @param asana_event [Hash] The event that Asana sent
|
@@ -66,6 +69,25 @@ module Checkoff
|
|
66
69
|
value.include? asana_event.fetch('change', {})['field']
|
67
70
|
when 'checkoff:parent.gid'
|
68
71
|
asana_event.fetch('parent', {})['gid'] == value
|
72
|
+
when 'checkoff:resource.gid'
|
73
|
+
asana_event.fetch('resource', {})['gid'] == value
|
74
|
+
when 'checkoff:fetched.completed'
|
75
|
+
# @type [Hash{String => String}]
|
76
|
+
# @sg-ignore
|
77
|
+
resource = asana_event.fetch('resource')
|
78
|
+
# @type [String]
|
79
|
+
resource_type = resource.fetch('resource_type')
|
80
|
+
unless resource_type == 'task'
|
81
|
+
raise "Teach me how to check #{key.inspect} on resource type #{resource_type.inspect}"
|
82
|
+
end
|
83
|
+
|
84
|
+
task_gid = resource.fetch('gid')
|
85
|
+
|
86
|
+
task = @tasks.task_by_gid(task_gid,
|
87
|
+
extra_fields: ['completed_at'],
|
88
|
+
only_uncompleted: false)
|
89
|
+
task_completed = !task.completed_at.nil?
|
90
|
+
task_completed == value
|
69
91
|
else
|
70
92
|
raise "Unknown filter key #{key}"
|
71
93
|
end
|
data/lib/checkoff/tasks.rb
CHANGED
@@ -135,7 +135,7 @@ module Checkoff
|
|
135
135
|
# @return [Asana::Resources::Task, nil]
|
136
136
|
def task_by_gid(task_gid,
|
137
137
|
extra_fields: [],
|
138
|
-
only_uncompleted:
|
138
|
+
only_uncompleted: true)
|
139
139
|
# @type [Hash]
|
140
140
|
options = projects.task_options.fetch(:options, {})
|
141
141
|
options[:fields] += extra_fields
|
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.170.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: 2024-01-
|
11
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|