checkoff 0.59.0 → 0.61.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: 19a77e1d0a58d1d80b234b2dca2654bd2b37f289bd5ad7ee3ad6973459032e5a
4
- data.tar.gz: '09ab639d4ddb008e09069ba819004b631bc6b0fc735b5332235d94d2b3671e7e'
3
+ metadata.gz: 9e011633f4a639594a0b4ea46cabc90841d2694197c09f6518225695b4e04701
4
+ data.tar.gz: cb8e3691a46709bc2d54aacae3e92f2e3e505f6431c9bb879411a4bffa7f155e
5
5
  SHA512:
6
- metadata.gz: 3f49402138523699db239d85718dfbce19c588bc283354b7fd2efe48045512dd314fedbfa3e92d4e7b8874bb29895a6ae10348b094db7e156744fbd9162f22f5
7
- data.tar.gz: 9d4c80f6a663a0b26053f904e8860b545775cbb13386d64e229e60d84abb765b1887c2811273df27801ab05503baff8402a38660af6daa45dec9280da9228321
6
+ metadata.gz: a75b29b334eb70a0a1dfb188e8e2ec69c5883348099d5dded33c279caf0b589336705bf7efb302354e2a045b5ea860b70b8c432bf22d5d0d57b2f388a1757f0b
7
+ data.tar.gz: 1fe68b769a151ab2af8a5cd6e9502e0197af0a437bd9f48f1661f7b4e18200210920b5c81cd386c3ac13fb76feaec958617916621474ccbf00a96925d2719812
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.59.0)
15
+ checkoff (0.61.0)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -22,17 +22,24 @@ PATH
22
22
  GEM
23
23
  remote: https://rubygems.org/
24
24
  specs:
25
- activesupport (7.0.8)
25
+ activesupport (7.1.0)
26
+ base64
27
+ bigdecimal
26
28
  concurrent-ruby (~> 1.0, >= 1.0.2)
29
+ connection_pool (>= 2.2.5)
30
+ drb
27
31
  i18n (>= 1.6, < 2)
28
32
  minitest (>= 5.1)
33
+ mutex_m
29
34
  tzinfo (~> 2.0)
30
35
  addressable (2.8.1)
31
36
  public_suffix (>= 2.0.2, < 6.0)
32
37
  ansi (1.5.0)
33
38
  ast (2.4.2)
34
39
  backport (1.2.0)
40
+ base64 (0.1.1)
35
41
  benchmark (0.2.1)
42
+ bigdecimal (3.1.4)
36
43
  builder (3.2.4)
37
44
  bump (0.10.0)
38
45
  cache (0.4.1)
@@ -43,11 +50,14 @@ GEM
43
50
  childprocess (4.1.0)
44
51
  coderay (1.1.3)
45
52
  concurrent-ruby (1.2.2)
53
+ connection_pool (2.4.1)
46
54
  crack (0.4.5)
47
55
  rexml
48
56
  dalli (3.2.6)
49
57
  diff-lcs (1.5.0)
50
58
  docile (1.4.0)
59
+ drb (2.1.1)
60
+ ruby2_keywords
51
61
  e2mmap (0.1.0)
52
62
  fakeweb (1.3.0)
53
63
  faraday (1.5.1)
@@ -110,6 +120,7 @@ GEM
110
120
  multi_json (1.15.0)
111
121
  multi_xml (0.6.0)
112
122
  multipart-post (2.1.1)
123
+ mutex_m (0.1.2)
113
124
  nokogiri (1.15.2)
114
125
  mini_portile2 (~> 2.8.2)
115
126
  racc (~> 1.4)
@@ -18,9 +18,15 @@ module Checkoff
18
18
 
19
19
  private
20
20
 
21
- FUNCTION_EVALUTORS = [
22
- Checkoff::SelectorClasses::Common::CustomFieldValueContainsAnyValueFunctionEvaluator,
23
- ].freeze
21
+ COMMON_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Common.constants.map do |const|
22
+ Checkoff::SelectorClasses::Common.const_get(const)
23
+ end - [Checkoff::SelectorClasses::Common::FunctionEvaluator]).freeze
24
+
25
+ PROJECT_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Project.constants.map do |const|
26
+ Checkoff::SelectorClasses::Project.const_get(const)
27
+ end - [Checkoff::SelectorClasses::Project::FunctionEvaluator]).freeze
28
+
29
+ FUNCTION_EVALUTORS = (COMMON_FUNCTION_EVALUATORS + PROJECT_FUNCTION_EVALUATORS).freeze
24
30
 
25
31
  # @return [Array<Class<ProjectSelectorClasses::FunctionEvaluator>>]
26
32
  def function_evaluators
@@ -70,6 +70,14 @@ module Checkoff
70
70
  end
71
71
  end
72
72
 
73
+ # Handle 'portfolios.ids' search url param
74
+ class PortfoliosIds < SimpleParam
75
+ # @return [Array<String>]
76
+ def convert
77
+ { 'portfolios.any' => single_value.split('~').join(',') }.to_a.flatten
78
+ end
79
+ end
80
+
73
81
  # Handle 'any_projects.ids' search url param
74
82
  class AnyProjectsIds < SimpleParam
75
83
  # @return [Array<String>]
@@ -188,6 +196,7 @@ module Checkoff
188
196
 
189
197
  # @type [Hash<String, Class<SimpleParam::SimpleParam>>] the mapping from param name to class
190
198
  ARGS = {
199
+ 'portfolios.ids' => SimpleParam::PortfoliosIds,
191
200
  'any_projects.ids' => SimpleParam::AnyProjectsIds,
192
201
  'not_projects.ids' => SimpleParam::NotProjectsIds,
193
202
  'completion' => SimpleParam::Completion,
@@ -5,6 +5,52 @@ require_relative 'task/function_evaluator'
5
5
  module Checkoff
6
6
  module SelectorClasses
7
7
  module Task
8
+ # :section_name_starts_with? function
9
+ class SectionNameStartsWithPFunctionEvaluator < FunctionEvaluator
10
+ def matches?
11
+ fn?(selector, :section_name_starts_with?)
12
+ end
13
+
14
+ # @param _index [Integer]
15
+ def evaluate_arg?(_index)
16
+ false
17
+ end
18
+
19
+ # @sg-ignore
20
+ # @param task [Asana::Resources::Task]
21
+ # @param section_name_prefix [String]
22
+ # @return [Boolean]
23
+ def evaluate(task, section_name_prefix)
24
+ section_names = task.memberships.map do |membership|
25
+ membership.fetch('section').fetch('name')
26
+ end
27
+ section_names.any? { |section_name| section_name.start_with? section_name_prefix }
28
+ end
29
+ end
30
+
31
+ # :in_section_named? function
32
+ class InSectionNamedPFunctionEvaluator < FunctionEvaluator
33
+ def matches?
34
+ fn?(selector, :in_section_named?)
35
+ end
36
+
37
+ # @param _index [Integer]
38
+ def evaluate_arg?(_index)
39
+ false
40
+ end
41
+
42
+ # @sg-ignore
43
+ # @param task [Asana::Resources::Task]
44
+ # @param section_name [String]
45
+ # @return [Boolean]
46
+ def evaluate(task, section_name)
47
+ section_names = task.memberships.map do |membership|
48
+ membership.fetch('section').fetch('name')
49
+ end
50
+ section_names.include? section_name
51
+ end
52
+ end
53
+
8
54
  # :tag function
9
55
  class TagPFunctionEvaluator < FunctionEvaluator
10
56
  def matches?
@@ -18,29 +18,15 @@ module Checkoff
18
18
 
19
19
  private
20
20
 
21
- FUNCTION_EVALUTORS = [
22
- Checkoff::SelectorClasses::Common::NotFunctionEvaluator,
23
- Checkoff::SelectorClasses::Common::NilPFunctionEvaluator,
24
- Checkoff::SelectorClasses::Common::EqualsPFunctionEvaluator,
25
- Checkoff::SelectorClasses::Task::TagPFunctionEvaluator,
26
- Checkoff::SelectorClasses::Common::CustomFieldValueFunctionEvaluator,
27
- Checkoff::SelectorClasses::Common::CustomFieldGidValueFunctionEvaluator,
28
- Checkoff::SelectorClasses::Common::CustomFieldGidValueContainsAnyGidFunctionEvaluator,
29
- Checkoff::SelectorClasses::Common::CustomFieldGidValueContainsAllGidsFunctionEvaluator,
30
- Checkoff::SelectorClasses::Common::AndFunctionEvaluator,
31
- Checkoff::SelectorClasses::Common::OrFunctionEvaluator,
32
- Checkoff::SelectorClasses::Task::DuePFunctionEvaluator,
33
- Checkoff::SelectorClasses::Task::DueBetweenRelativePFunctionEvaluator,
34
- Checkoff::SelectorClasses::Task::UnassignedPFunctionEvaluator,
35
- Checkoff::SelectorClasses::Task::DueDateSetPFunctionEvaluator,
36
- Checkoff::SelectorClasses::Task::FieldLessThanNDaysAgoPFunctionEvaluator,
37
- Checkoff::SelectorClasses::Task::FieldGreaterThanOrEqualToNDaysFromTodayPFunctionEvaluator,
38
- Checkoff::SelectorClasses::Task::CustomFieldLessThanNDaysFromNowFunctionEvaluator,
39
- Checkoff::SelectorClasses::Task::CustomFieldGreaterThanOrEqualToNDaysFromNowFunctionEvaluator,
40
- Checkoff::SelectorClasses::Task::LastStoryCreatedLessThanNDaysAgoFunctionEvaluator,
41
- Checkoff::SelectorClasses::Common::StringLiteralEvaluator,
42
- Checkoff::SelectorClasses::Task::EstimateExceedsDurationFunctionEvaluator,
43
- ].freeze
21
+ COMMON_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Common.constants.map do |const|
22
+ Checkoff::SelectorClasses::Common.const_get(const)
23
+ end - [Checkoff::SelectorClasses::Common::FunctionEvaluator]).freeze
24
+
25
+ TASK_FUNCTION_EVALUATORS = (Checkoff::SelectorClasses::Task.constants.map do |const|
26
+ Checkoff::SelectorClasses::Task.const_get(const)
27
+ end - [Checkoff::SelectorClasses::Task::FunctionEvaluator]).freeze
28
+
29
+ FUNCTION_EVALUTORS = (COMMON_FUNCTION_EVALUATORS + TASK_FUNCTION_EVALUATORS).freeze
44
30
 
45
31
  # @return [Array<Class<TaskSelectorClasses::FunctionEvaluator>>]
46
32
  def function_evaluators
@@ -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.59.0'
6
+ VERSION = '0.61.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.59.0
4
+ version: 0.61.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-10-04 00:00:00.000000000 Z
11
+ date: 2023-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport