checkoff 0.118.0 → 0.119.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/lib/checkoff/internal/search_url/date_param_converter.rb +21 -3
- data/lib/checkoff/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e003347c4270077540d8ab45c35a1901241c13c4be077301229242a85232230
|
4
|
+
data.tar.gz: 9ae02faf012077dd032f662a364b91877860671dbf750bd85828f6eda737ac50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1e6c012f8d278e652349a9f86953fd594057d6eb01289b661170781f50b62e145288f12dd353a6c622f92301465783e6c2abaa5f855e93808435f56cf40f778
|
7
|
+
data.tar.gz: 0e7e3d03fa75ae11e39ab0c311c3e0d9f24cb6a63adaa3e9ecec58321a2c3ffe2234b775188da36bdeb7b3ef179a3c86ac0ad5821e688bb45d4e3923977c1b19
|
data/Gemfile.lock
CHANGED
@@ -20,7 +20,7 @@ module Checkoff
|
|
20
20
|
|
21
21
|
out = nil
|
22
22
|
|
23
|
-
%w[due_date start_date].each do |prefix|
|
23
|
+
%w[due_date start_date completion_date].each do |prefix|
|
24
24
|
next unless date_url_params.key? "#{prefix}.operator"
|
25
25
|
raise 'Teach me how to handle simultaneous date parameters' unless out.nil?
|
26
26
|
|
@@ -44,10 +44,13 @@ module Checkoff
|
|
44
44
|
# due_date.unit=day
|
45
45
|
operator = get_single_param("#{prefix}.operator")
|
46
46
|
|
47
|
-
out =
|
47
|
+
out = case operator
|
48
|
+
when 'through_next'
|
48
49
|
handle_through_next(prefix)
|
49
|
-
|
50
|
+
when 'between'
|
50
51
|
handle_between(prefix)
|
52
|
+
when 'within_last'
|
53
|
+
handle_within_last(prefix)
|
51
54
|
else
|
52
55
|
raise "Teach me how to handle date mode: #{operator.inspect}."
|
53
56
|
end
|
@@ -62,6 +65,7 @@ module Checkoff
|
|
62
65
|
API_PREFIX = {
|
63
66
|
'due_date' => 'due_on',
|
64
67
|
'start_date' => 'start_on',
|
68
|
+
'completion_date' => 'completed_on',
|
65
69
|
}.freeze
|
66
70
|
|
67
71
|
# @param prefix [String]
|
@@ -97,6 +101,20 @@ module Checkoff
|
|
97
101
|
[{ "#{API_PREFIX.fetch(prefix)}.after" => after.to_s }, []]
|
98
102
|
end
|
99
103
|
|
104
|
+
# @param prefix [String]
|
105
|
+
# @return [Array(Hash<String, String>, Array<[Symbol, Array]>)] See https://developers.asana.com/docs/search-tasks-in-a-workspace
|
106
|
+
def handle_within_last(prefix)
|
107
|
+
value = get_single_param("#{prefix}.value").to_i
|
108
|
+
|
109
|
+
validate_unit_is_day!(prefix)
|
110
|
+
|
111
|
+
# @sg-ignore
|
112
|
+
# @type [Date]
|
113
|
+
after = Date.today - value
|
114
|
+
|
115
|
+
[{ "#{API_PREFIX.fetch(prefix)}.after" => after.to_s }, []]
|
116
|
+
end
|
117
|
+
|
100
118
|
# @param param_key [String]
|
101
119
|
# @return [String]
|
102
120
|
def get_single_param(param_key)
|
data/lib/checkoff/version.rb
CHANGED