checkoff 0.29.4 → 0.31.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: a73a81aadb4e180a59baf5eac5184070a677d791ead8d608f894e71950e03125
4
- data.tar.gz: '0590cbfeefb9b56600dfd2450e3731ea8472d4efa21b1b8e6adf4719e949425f'
3
+ metadata.gz: 9098d5cbdef080b54a70384a623e904981f3c9b395a445c2d30c0c6ce734c4f7
4
+ data.tar.gz: 59b28f88a8f4bb7f6c9bd5cc03f28dda3232032670f08aa304bdcf6c7d824290
5
5
  SHA512:
6
- metadata.gz: 2459b37ea4a58cc8198ad0d6fa43f772d70e3278ec77254d35471d299b06c5afe00c901f7992e305d3ad392727c35977ac80b977f11dddbb1f1f0c1e4e148804
7
- data.tar.gz: 90c1d606f7d2babcf8056e3464aa84d5f7994a1adab568f156468462d46acbccd8b52e0119e7a522a8c4b9083f8e9a17a55f05ec333c567223e50b4b8fb92dba
6
+ metadata.gz: bab2cdcbb4aad51cdb444d108a47cc13a1cff97567db5455894364b010cdb851f9c66bcd420d1add74e0b64e3e5358d64ba7873d5f25cb074595e7edbe805f1a
7
+ data.tar.gz: 3d579e7e952155057addede0bd1c7877986a3900cd77f341eaf9d09b0f80604fae1105d6ba1f247694f5ec52fa50fb6d830c083a2a75f4a56845874772b0df5a
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.29.4)
15
+ checkoff (0.31.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -38,7 +38,7 @@ GEM
38
38
  cache (>= 0.2.1)
39
39
  chef-utils (17.10.0)
40
40
  concurrent-ruby
41
- childprocess (4.0.0)
41
+ childprocess (4.1.0)
42
42
  coderay (1.1.3)
43
43
  concurrent-ruby (1.1.10)
44
44
  crack (0.4.5)
@@ -111,7 +111,7 @@ GEM
111
111
  multi_json (~> 1.3)
112
112
  multi_xml (~> 0.5)
113
113
  rack (>= 1.2, < 4)
114
- overcommit (0.58.0)
114
+ overcommit (0.60.0)
115
115
  childprocess (>= 0.6.3, < 5)
116
116
  iniparse (~> 1.4)
117
117
  rexml (~> 3.2)
@@ -185,6 +185,7 @@ PLATFORMS
185
185
  x86_64-darwin-20
186
186
  x86_64-darwin-21
187
187
  x86_64-linux
188
+ x86_64-linux-musl
188
189
 
189
190
  DEPENDENCIES
190
191
  asana!
@@ -196,11 +197,11 @@ DEPENDENCIES
196
197
  minitest-profile
197
198
  minitest-reporters
198
199
  mocha (~> 2.0.0.alpha.1)
199
- overcommit (>= 0.58.0)
200
+ overcommit (>= 0.60.0, < 0.61.0)
200
201
  pry
201
202
  rake (~> 13.0)
202
203
  rspec (>= 3.4)
203
- rubocop (~> 1.36)
204
+ rubocop (~> 1.36, < 1.44)
204
205
  rubocop-minitest
205
206
  rubocop-rake
206
207
  simplecov (>= 0.18.0)
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016-2022, Vince Broz
3
+ Copyright (c) 2016-2023, Vince Broz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/bin/rubocop ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("rubocop", "rubocop")
data/checkoff.gemspec CHANGED
@@ -40,11 +40,13 @@ Gem::Specification.new do |spec|
40
40
  # 0.58.0 and 0.57.0 don't seem super compatible with signatures, and
41
41
  # magit doesn't seem to want to use the bundled version at the moment,
42
42
  # so let's favor the more recent version...
43
- spec.add_development_dependency 'overcommit', ['>=0.58.0']
43
+ spec.add_development_dependency 'overcommit', ['>=0.60.0', '<0.61.0']
44
44
  spec.add_development_dependency 'pry'
45
45
  spec.add_development_dependency 'rake', '~> 13.0'
46
46
  spec.add_development_dependency 'rspec', '>=3.4'
47
- spec.add_development_dependency 'rubocop', ['~> 1.36']
47
+ # I haven't adapted things to Gemspec/DevelopmentDependencies yet,
48
+ # which arrives in 1.44
49
+ spec.add_development_dependency 'rubocop', ['~> 1.36', '<1.44']
48
50
  spec.add_development_dependency 'rubocop-minitest'
49
51
  spec.add_development_dependency 'rubocop-rake'
50
52
  # ensure version with branch coverage
@@ -1,4 +1,5 @@
1
1
  {
2
+ "_output_dir": "/Users/broz/src/checkoff/.git/cookiecutter",
2
3
  "_template": "https://github.com/apiology/cookiecutter-gem",
3
4
  "email": "vince@broz.cc",
4
5
  "full_name": "Vince Broz",
data/fix.sh CHANGED
@@ -100,6 +100,7 @@ ensure_ruby_build_requirements() {
100
100
  ensure_dev_library readline/readline.h readline libreadline-dev
101
101
  ensure_dev_library zlib.h zlib zlib1g-dev
102
102
  ensure_dev_library openssl/ssl.h openssl libssl-dev
103
+ ensure_dev_library yaml.h libyaml libyaml-dev
103
104
  }
104
105
 
105
106
  ensure_latest_ruby_build_definitions() {
@@ -188,7 +189,7 @@ ensure_bundle() {
188
189
  #
189
190
  # This affects nokogiri, which will try to reinstall itself in
190
191
  # Docker builds where it's already installed if this is not run.
191
- for platform in x86_64-darwin-21 x86_64-linux
192
+ for platform in x86_64-darwin-21 x86_64-linux x86_64-linux-musl
192
193
  do
193
194
  grep "${platform:?}" Gemfile.lock >/dev/null 2>&1 || bundle lock --add-platform "${platform:?}"
194
195
  done
@@ -284,7 +285,7 @@ ensure_python_build_requirements() {
284
285
  ensure_python_versions() {
285
286
  # You can find out which feature versions are still supported / have
286
287
  # been release here: https://www.python.org/downloads/
287
- python_versions="$(latest_python_version 3.10)"
288
+ python_versions="$(latest_python_version 3.11)"
288
289
 
289
290
  echo "Latest Python versions: ${python_versions}"
290
291
 
@@ -55,6 +55,7 @@ module Checkoff
55
55
  'greater_than' => CustomFieldVariant::GreaterThan,
56
56
  'doesnt_contain_any' => CustomFieldVariant::DoesntContainAny,
57
57
  'contains_any' => CustomFieldVariant::ContainsAny,
58
+ 'contains_all' => CustomFieldVariant::ContainsAll,
58
59
  }.freeze
59
60
 
60
61
  def convert_single_custom_field_params(gid, single_custom_field_params)
@@ -99,6 +99,20 @@ module Checkoff
99
99
  end
100
100
  end
101
101
 
102
+ # This is used in the UI for multi-select fields
103
+ #
104
+ # custom_field_#{gid}.variant = 'contains_all'
105
+ class ContainsAll < CustomFieldVariant
106
+ def convert
107
+ selected_options = fetch_solo_param("custom_field_#{gid}.selected_options").split('~')
108
+
109
+ [{ "custom_fields.#{gid}.is_set" => 'true' },
110
+ ['custom_field_gid_value_contains_all_gids',
111
+ gid,
112
+ selected_options]]
113
+ end
114
+ end
115
+
102
116
  # custom_field_#{gid}.variant = 'no_value'
103
117
  class NoValue < CustomFieldVariant
104
118
  def convert
@@ -35,6 +35,35 @@ module Checkoff
35
35
  end
36
36
 
37
37
  attr_reader :task_selector
38
+
39
+ def pull_enum_values(custom_field)
40
+ resource_subtype = custom_field.fetch('resource_subtype')
41
+ case resource_subtype
42
+ when 'enum'
43
+ [custom_field.fetch('enum_value')]
44
+ when 'multi_enum'
45
+ custom_field.fetch('multi_enum_values')
46
+ else
47
+ raise "Teach me how to handle resource_subtype #{resource_subtype}"
48
+ end
49
+ end
50
+
51
+ def find_gids(custom_field, enum_value)
52
+ if enum_value.nil?
53
+ []
54
+ else
55
+ raise "Unexpected enabled value on custom field: #{custom_field}" if enum_value.fetch('enabled') == false
56
+
57
+ [enum_value.fetch('gid')]
58
+ end
59
+ end
60
+
61
+ def pull_custom_field_values_gids(task, custom_field_gid)
62
+ custom_field = pull_custom_field_or_raise(task, custom_field_gid)
63
+ pull_enum_values(custom_field).flat_map do |enum_value|
64
+ find_gids(custom_field, enum_value)
65
+ end
66
+ end
38
67
  end
39
68
 
40
69
  # :and function
@@ -96,6 +125,17 @@ module Checkoff
96
125
  end
97
126
  end
98
127
 
128
+ # :due_date_set function
129
+ class DueDateSetPFunctionEvaluator < FunctionEvaluator
130
+ def matches?
131
+ fn?(task_selector, :due_date_set)
132
+ end
133
+
134
+ def evaluate(task)
135
+ !task.due_at.nil? || !task.due_on.nil?
136
+ end
137
+ end
138
+
99
139
  # :custom_field_value function
100
140
  class CustomFieldValueFunctionEvaluator < FunctionEvaluator
101
141
  def matches?
@@ -152,35 +192,23 @@ module Checkoff
152
192
  custom_field_values_gids.include?(custom_field_value)
153
193
  end
154
194
  end
195
+ end
155
196
 
156
- private
157
-
158
- def pull_enum_values(custom_field)
159
- resource_subtype = custom_field.fetch('resource_subtype')
160
- case resource_subtype
161
- when 'enum'
162
- [custom_field.fetch('enum_value')]
163
- when 'multi_enum'
164
- custom_field.fetch('multi_enum_values')
165
- else
166
- raise "Teach me how to handle resource_subtype #{resource_subtype}"
167
- end
197
+ # :custom_field_gid_value_contains_all_gids function
198
+ class CustomFieldGidValueContainsAllGidsFunctionEvaluator < FunctionEvaluator
199
+ def matches?
200
+ fn?(task_selector, :custom_field_gid_value_contains_all_gids)
168
201
  end
169
202
 
170
- def find_gids(custom_field, enum_value)
171
- if enum_value.nil?
172
- []
173
- else
174
- raise "Unexpected enabled value on custom field: #{custom_field}" if enum_value.fetch('enabled') == false
175
-
176
- [enum_value.fetch('gid')]
177
- end
203
+ def evaluate_arg?(_index)
204
+ false
178
205
  end
179
206
 
180
- def pull_custom_field_values_gids(task, custom_field_gid)
181
- custom_field = pull_custom_field_or_raise(task, custom_field_gid)
182
- pull_enum_values(custom_field).flat_map do |enum_value|
183
- find_gids(custom_field, enum_value)
207
+ def evaluate(task, custom_field_gid, custom_field_values_gids)
208
+ actual_custom_field_values_gids = pull_custom_field_values_gids(task, custom_field_gid)
209
+
210
+ custom_field_values_gids.all? do |custom_field_value|
211
+ actual_custom_field_values_gids.include?(custom_field_value)
184
212
  end
185
213
  end
186
214
  end
@@ -200,8 +228,10 @@ module Checkoff
200
228
  CustomFieldValueFunctionEvaluator,
201
229
  CustomFieldGidValueFunctionEvaluator,
202
230
  CustomFieldGidValueContainsAnyGidFunctionEvaluator,
231
+ CustomFieldGidValueContainsAllGidsFunctionEvaluator,
203
232
  AndFunctionEvaluator,
204
233
  DuePFunctionEvaluator,
234
+ DueDateSetPFunctionEvaluator,
205
235
  ].freeze
206
236
 
207
237
  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.29.4'
6
+ VERSION = '0.31.0'
7
7
  end
data/requirements_dev.txt CHANGED
@@ -1,2 +1,2 @@
1
- pip==21.1
2
- yamllint==1.26.0
1
+ pip==21.1.3
2
+ yamllint==1.29.0
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.29.4
4
+ version: 0.31.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-02-23 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -184,14 +184,20 @@ dependencies:
184
184
  requirements:
185
185
  - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: 0.58.0
187
+ version: 0.60.0
188
+ - - "<"
189
+ - !ruby/object:Gem::Version
190
+ version: 0.61.0
188
191
  type: :development
189
192
  prerelease: false
190
193
  version_requirements: !ruby/object:Gem::Requirement
191
194
  requirements:
192
195
  - - ">="
193
196
  - !ruby/object:Gem::Version
194
- version: 0.58.0
197
+ version: 0.60.0
198
+ - - "<"
199
+ - !ruby/object:Gem::Version
200
+ version: 0.61.0
195
201
  - !ruby/object:Gem::Dependency
196
202
  name: pry
197
203
  requirement: !ruby/object:Gem::Requirement
@@ -241,6 +247,9 @@ dependencies:
241
247
  - - "~>"
242
248
  - !ruby/object:Gem::Version
243
249
  version: '1.36'
250
+ - - "<"
251
+ - !ruby/object:Gem::Version
252
+ version: '1.44'
244
253
  type: :development
245
254
  prerelease: false
246
255
  version_requirements: !ruby/object:Gem::Requirement
@@ -248,6 +257,9 @@ dependencies:
248
257
  - - "~>"
249
258
  - !ruby/object:Gem::Version
250
259
  version: '1.36'
260
+ - - "<"
261
+ - !ruby/object:Gem::Version
262
+ version: '1.44'
251
263
  - !ruby/object:Gem::Dependency
252
264
  name: rubocop-minitest
253
265
  requirement: !ruby/object:Gem::Requirement
@@ -363,6 +375,7 @@ files:
363
375
  - bin/console
364
376
  - bin/overcommit
365
377
  - bin/rake
378
+ - bin/rubocop
366
379
  - bin/setup
367
380
  - checkoff.gemspec
368
381
  - docs/cookiecutter_input.json