checkoff 0.43.0 → 0.44.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 +2 -2
- data/lib/checkoff/internal/task_selector_evaluator.rb +25 -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: 413eeaac4e3e2a4784e5fca4930fed96beedd594b87f1c8d80460aabe4ee1dd3
|
4
|
+
data.tar.gz: 4127604e8d5c3605d49c2fda86fe0c0e1bed95aaeadfc493d8a2b02c19bed94d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 001c49dab8df9d273f2c395dd422509afa82c856712b7dfef9b7c65bf7f23c7d3ada832d32e888b188d38751716ee7e54c8d144b4575cd2de384946002ae6fc5
|
7
|
+
data.tar.gz: a10f6ee8a33870277503458dc19809e642d837899c31c1698ba04942356386fe09c713643db3f3694eca7d5495c43fe13c93d2ae7785e3ad383aeed88651e2f0
|
data/Gemfile.lock
CHANGED
@@ -12,7 +12,7 @@ GIT
|
|
12
12
|
PATH
|
13
13
|
remote: .
|
14
14
|
specs:
|
15
|
-
checkoff (0.
|
15
|
+
checkoff (0.44.0)
|
16
16
|
activesupport
|
17
17
|
asana (> 0.10.0)
|
18
18
|
cache_method
|
@@ -22,7 +22,7 @@ PATH
|
|
22
22
|
GEM
|
23
23
|
remote: https://rubygems.org/
|
24
24
|
specs:
|
25
|
-
activesupport (7.0.5)
|
25
|
+
activesupport (7.0.5.1)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 1.6, < 2)
|
28
28
|
minitest (>= 5.1)
|
@@ -339,6 +339,30 @@ module Checkoff
|
|
339
339
|
end
|
340
340
|
end
|
341
341
|
|
342
|
+
# :custom_field_greater_than_or_equal_to_n_days_from_now function
|
343
|
+
class CustomFieldGreaterThanOrEqualToNDaysFromNowFunctionEvaluator < FunctionEvaluator
|
344
|
+
def matches?
|
345
|
+
fn?(task_selector, :custom_field_greater_than_or_equal_to_n_days_from_now)
|
346
|
+
end
|
347
|
+
|
348
|
+
def evaluate_arg?(_index)
|
349
|
+
false
|
350
|
+
end
|
351
|
+
|
352
|
+
# @param task [Asana::Resources::Task]
|
353
|
+
# @param custom_field_name [String]
|
354
|
+
# @param num_days [Integer]
|
355
|
+
# @return [Boolean]
|
356
|
+
def evaluate(task, custom_field_name, num_days)
|
357
|
+
custom_field = pull_custom_field_by_name_or_raise(task, custom_field_name)
|
358
|
+
|
359
|
+
time_str = custom_field.fetch('display_value')
|
360
|
+
time = Time.parse(time_str)
|
361
|
+
n_days_from_now = (Time.now + (num_days * 24 * 60 * 60))
|
362
|
+
time >= n_days_from_now
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
342
366
|
# String literals
|
343
367
|
class StringLiteralEvaluator < FunctionEvaluator
|
344
368
|
def matches?
|
@@ -376,6 +400,7 @@ module Checkoff
|
|
376
400
|
DuePFunctionEvaluator,
|
377
401
|
DueDateSetPFunctionEvaluator,
|
378
402
|
CustomFieldLessThanNDaysFromNowFunctionEvaluator,
|
403
|
+
CustomFieldGreaterThanOrEqualToNDaysFromNowFunctionEvaluator,
|
379
404
|
StringLiteralEvaluator,
|
380
405
|
].freeze
|
381
406
|
|
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.44.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: 2023-06-
|
11
|
+
date: 2023-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|