checkoff 0.25.0 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0163bf29ae74fcf0cf1b95a199f088b1ceb3313a8b1429491c3b08c0b662e52e
4
- data.tar.gz: 683ee42666b4ad5594c77b79ec509c5843e88384093715fbc3f0d7d189086ff8
3
+ metadata.gz: 1adcf7ca7bea1514f07f234a4952e550afeb47be68882a631d26b88231839ec4
4
+ data.tar.gz: e2d86531a6e256cbfb9315199b529d6e587263dc6a750c6ab3a28faa8e1f0b12
5
5
  SHA512:
6
- metadata.gz: 2d1a3b432d4b101558595c35b0dda58a2dadc7802bb1976091c50518355b61985287ec6089b1bfeb4f0b3588dc7426488ffcd3f4df1a52f887fb231cd49132d7
7
- data.tar.gz: 68523d9b54bb9d7ab79ee23167a75a1218b6de0673d09ff71f78fad9ddebfa802c110faeb54d84c50be45ed94ea11ccf4d833d7bd87e6d453ab249df1534e2c4
6
+ metadata.gz: 636615e7e3b49a763e71c867718b6441bde385eb30533263c67030cb9b6febd7a3c233087daec5c30e2ec1e2bf24d0fe97c7480faf6feb18baf121c140e14642
7
+ data.tar.gz: ab00d105d5f79e402c2030a4a982fe3b863270c9477ffa4c4fccf686d79a1280ab3a20561be72311711ee481544a206f2af9785eaaab5db3d3646a466f6f888d
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.25.0)
15
+ checkoff (0.26.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -33,14 +33,17 @@ module Checkoff
33
33
  end
34
34
 
35
35
  def merge_args_and_task_selectors(args, new_args, task_selector, new_task_selector)
36
- args = args.merge(new_args)
37
- return [args, task_selector] if new_task_selector == []
36
+ final_args = args.merge(new_args)
38
37
 
39
- raise 'Teach me how to merge task selectors' unless task_selector == []
38
+ final_task_selector = if new_task_selector == []
39
+ task_selector
40
+ elsif task_selector == []
41
+ new_task_selector
42
+ else
43
+ [:and, task_selector, new_task_selector]
44
+ end
40
45
 
41
- task_selector = new_task_selector
42
-
43
- [args, task_selector]
46
+ [final_args, final_task_selector]
44
47
  end
45
48
 
46
49
  VARIANTS = {
@@ -20,6 +20,17 @@ module Checkoff
20
20
  attr_reader :task_selector
21
21
  end
22
22
 
23
+ # :and function
24
+ class AndFunctionEvaluator < FunctionEvaluator
25
+ def matches?
26
+ fn?(task_selector, :and)
27
+ end
28
+
29
+ def evaluate(_task, lhs, rhs)
30
+ lhs && rhs
31
+ end
32
+ end
33
+
23
34
  # :not function
24
35
  class NotFunctionEvaluator < FunctionEvaluator
25
36
  def matches?
@@ -154,6 +165,7 @@ module Checkoff
154
165
  TagPFunctionEvaluator,
155
166
  CustomFieldValueFunctionEvaluator,
156
167
  CustomFieldGidValueContainsAnyGidFunctionEvaluator,
168
+ AndFunctionEvaluator,
157
169
  ].freeze
158
170
 
159
171
  def evaluate(task_selector)
@@ -3,5 +3,5 @@
3
3
  # Command-line and gem client for Asana (unofficial)
4
4
  module Checkoff
5
5
  # Version of library
6
- VERSION = '0.25.0'
6
+ VERSION = '0.26.0'
7
7
  end
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.25.0
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz