checkoff 0.22.0 → 0.23.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '084d67648e9668ace7b8d103e4e1f9ec1d8d66bb0048cc1f8c7d652dd115397c'
4
- data.tar.gz: e1cf9b3f5639841462290ac1a5228fa5ca3dba3d4e70c62d84644184e63e6b89
3
+ metadata.gz: 53900365a6e35f146515f3a6043bb12907a67cefa1d0fd86f92b90e700946946
4
+ data.tar.gz: 57ccc5292ae4f07fe278697c7377d6187859c5a0b1b0be6b301ca945a18579eb
5
5
  SHA512:
6
- metadata.gz: f49cd3bded68cdcc502b26ac03fe6b7e073aaa93294c4104b36c7bfb014fbbc9e3a792fb85d712e39251ec13ce1e7430e067c06a3075120bb37bcf23de457672
7
- data.tar.gz: a4886b2dabc6332688434e0bce0009c1bf1db10b97588f857dc729320b5f840e4f8368afaf03ea78bdbf2e1025c1f4fa9d23839d19d0df8fa2650839226915f0
6
+ metadata.gz: f08fb1c0242675a728cf58151c4e9a990cd8bf961fd75ce7e01b154c39e759b557289651ff16033599809f1df251d4bbed45f02c07cb37aa70e7abfb8e714169
7
+ data.tar.gz: 248aa5d50f3245dc1af18f4afcef40194d32a57deeb12bec0444965bacbdef523a4a60dda7f473a09deaa8ef1b8a1d499c2d434a02ac83bad41d9c6cd39ebc4b
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.22.0)
15
+ checkoff (0.23.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -48,6 +48,7 @@ module Checkoff
48
48
  'no_value' => CustomFieldVariant::NoValue,
49
49
  'is_not' => CustomFieldVariant::IsNot,
50
50
  'less_than' => CustomFieldVariant::LessThan,
51
+ 'greater_than' => CustomFieldVariant::GreaterThan,
51
52
  }.freeze
52
53
 
53
54
  def convert_single_custom_field_params(gid, single_custom_field_params)
@@ -14,34 +14,40 @@ module Checkoff
14
14
  private
15
15
 
16
16
  attr_reader :gid, :remaining_params
17
- end
18
17
 
19
- # custom_field_#{gid}.variant = 'less_than'
20
- class LessThan < CustomFieldVariant
21
- def convert
22
- max_param = "custom_field_#{gid}.max"
18
+ def fetch_solo_param(param_name)
23
19
  case remaining_params.keys
24
- when [max_param]
25
- convert_single_custom_field_less_than_params_max_param(max_param)
20
+ when [param_name]
21
+ param_values = remaining_params.fetch(param_name)
22
+ unless param_values.length == 1
23
+ raise "Teach me how to handle these remaining keys for #{param_name}: #{remaining_params}"
24
+ end
25
+
26
+ param_values[0]
26
27
  else
27
28
  raise "Teach me how to handle #{remaining_params}"
28
29
  end
29
30
  end
31
+ end
30
32
 
31
- private
32
-
33
- def convert_single_custom_field_less_than_params_max_param(max_param)
34
- max_values = remaining_params.fetch(max_param)
35
- unless max_values.length == 1
36
- raise "Teach me how to handle these remaining keys for #{max_param}: #{remaining_params}"
37
- end
38
-
39
- max_value = max_values[0]
33
+ # custom_field_#{gid}.variant = 'less_than'
34
+ class LessThan < CustomFieldVariant
35
+ def convert
36
+ max_value = fetch_solo_param("custom_field_#{gid}.max")
40
37
  empty_task_selector = []
41
38
  [{ "custom_fields.#{gid}.less_than" => max_value }, empty_task_selector]
42
39
  end
43
40
  end
44
41
 
42
+ # custom_field_#{gid}.variant = 'greater_than'
43
+ class GreaterThan < CustomFieldVariant
44
+ def convert
45
+ max_value = fetch_solo_param("custom_field_#{gid}.min")
46
+ empty_task_selector = []
47
+ [{ "custom_fields.#{gid}.greater_than" => max_value }, empty_task_selector]
48
+ end
49
+ end
50
+
45
51
  # custom_field_#{gid}.variant = 'is_not'
46
52
  class IsNot < CustomFieldVariant
47
53
  def convert
@@ -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.22.0'
6
+ VERSION = '0.23.0'
7
7
  end
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.22.0
4
+ version: 0.23.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-01-09 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport