checkoff 0.233.0 → 0.237.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: 9218ef611b8c8112e754246e1eadd4bbb5c92397cf98ca8e834f8391a1ce8e4c
4
- data.tar.gz: '082d8bdba278d67312003fca7ac6a3fef158b43f3b14a4762b40dae4c73867d6'
3
+ metadata.gz: 3721e81c2b0e616139f7377d6cacc03a772f64c33ec479ebcbb5ecd653e2fe22
4
+ data.tar.gz: 8695cd726cb363ba564283c5f93cbb931e8f2016bcd6f6f02822cf776b97fc80
5
5
  SHA512:
6
- metadata.gz: 8e06342012be266e5e1bae0002ea37bb980c7a37334640ddb0a32067dab2de2f23e35653c1d95eb3d967c8ec328e2bf6be0b96ac681f9c013409bd4d91b979ae
7
- data.tar.gz: 99565139c87dd3ef0dbb4a3c577e3bbb367429505861115d0778c25b36ccf0e93efc73da11c8487d7aae9f31d053e24d6806bac93eecce149bc719abd1389dfa
6
+ metadata.gz: 19ab21f6d036a0a3fb78cbdc74553f5b877406b4bd9c4332c10a0638e780ac9ae835f26faa05d73d2d92051a99622e8a86cac8935181265007d41b26f7dad1a3
7
+ data.tar.gz: 0de250ef8a7c625631bdf84442cdee2f0b4df5329a56536715e10179661c07788d2eedcde69e489ad3ba1814369a6c41fa089736133af20ee039c62616852af3
data/lib/checkoff/cli.rb CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  # frozen_string_literal: true
5
5
 
6
+ require 'json'
6
7
  require 'ostruct'
7
8
  require 'gli'
8
9
  require 'cache_method'
@@ -208,13 +209,16 @@ module Checkoff
208
209
 
209
210
  # @param workspace [String, Symbol]
210
211
  # @param project [String, Symbol]
212
+ #
211
213
  # @return [String]
214
+ # @sg-ignore
212
215
  def run_on_project(workspace, project)
213
216
  tasks_by_section =
214
217
  sections.tasks_by_section(workspace, project)
215
218
  tasks_by_section.update(tasks_by_section) do |_key, tasks|
216
219
  tasks_to_hash(tasks)
217
220
  end
221
+ # @sg-ignore
218
222
  tasks_by_section.to_json
219
223
  end
220
224
 
@@ -222,9 +226,11 @@ module Checkoff
222
226
  # @param project [String, Symbol]
223
227
  # @param section [String, Symbol, nil]
224
228
  # @return [String]
229
+ # @sg-ignore
225
230
  def run_on_section(workspace, project, section)
226
231
  section = nil if section == ''
227
232
  tasks = sections.tasks(workspace, project, section) || []
233
+ # @sg-ignore
228
234
  tasks_to_hash(tasks).to_json
229
235
  end
230
236
 
@@ -233,9 +239,11 @@ module Checkoff
233
239
  # @param section [String, Symbol, nil]
234
240
  # @param task_name [String]
235
241
  # @return [String]
242
+ # @sg-ignore
236
243
  def run_on_task(workspace, project, section, task_name)
237
244
  section = nil if section == ''
238
245
  task = tasks.task(workspace, project, task_name, section_name: section)
246
+ # @sg-ignore
239
247
  task_to_hash(task).to_json
240
248
  end
241
249
 
@@ -145,6 +145,15 @@ module Checkoff
145
145
  end
146
146
  end
147
147
 
148
+ # Handle 'all_tags.ids' search url param
149
+ class AllTagsIds < SimpleParam
150
+ # @return [Array<String>]
151
+ def convert
152
+ tag_ids = single_value.split('~')
153
+ ['tags.all', tag_ids.join(',')]
154
+ end
155
+ end
156
+
148
157
  # Handle 'sort' search url param
149
158
  class Sort < SimpleParam
150
159
  # @return [Array<String>]
@@ -182,6 +191,16 @@ module Checkoff
182
191
  raise "Teach me how to handle #{key} = #{values}"
183
192
  end
184
193
  end
194
+
195
+ # Handle 'locatedIn' search url param
196
+ class LocatedIn < SimpleParam
197
+ # @return [Array<String>]
198
+ def convert
199
+ return [] if single_value == 'anywhere'
200
+
201
+ raise "Teach me how to handle #{key} = #{values}"
202
+ end
203
+ end
185
204
  end
186
205
 
187
206
  # Convert simple parameters - ones where the param name itself
@@ -220,10 +239,12 @@ module Checkoff
220
239
  'completion' => SimpleParam::Completion,
221
240
  'not_tags.ids' => SimpleParam::NotTagsIds,
222
241
  'any_tags.ids' => SimpleParam::AnyTagsIds,
242
+ 'all_tags.ids' => SimpleParam::AllTagsIds,
223
243
  'subtask' => SimpleParam::Subtask,
224
244
  'sort' => SimpleParam::Sort,
225
245
  'milestone' => SimpleParam::Milestone,
226
246
  'searched_type' => SimpleParam::SearchedType,
247
+ 'locatedIn' => SimpleParam::LocatedIn,
227
248
  }.freeze
228
249
  private_constant :ARGS
229
250
 
@@ -17,6 +17,7 @@ module Checkoff
17
17
  # Pull portfolios from Asana
18
18
  class Portfolios
19
19
  extend T::Sig
20
+
20
21
  # @!parse
21
22
  # extend CacheMethod::ClassMethods
22
23
 
@@ -57,7 +58,6 @@ module Checkoff
57
58
  # @param workspace_name [String]
58
59
  # @param portfolio_name [String]
59
60
  #
60
- # @sg-ignore
61
61
  # @return [Asana::Resources::Portfolio,nil]
62
62
  def portfolio(workspace_name, portfolio_name)
63
63
  workspace = workspaces.workspace_or_raise(workspace_name)
@@ -122,10 +122,8 @@ module Checkoff
122
122
  class << self
123
123
  # @return [void]
124
124
  def run
125
- # @sg-ignore
126
125
  # @type [String]
127
126
  workspace_name = ARGV[0] || raise('Please pass workspace name as first argument')
128
- # @sg-ignore
129
127
  # @type [String]
130
128
  portfolio_name = ARGV[1] || raise('Please pass portfolio name as second argument')
131
129
  portfolios = Checkoff::Portfolios.new
@@ -4,5 +4,5 @@
4
4
  # Command-line and gem client for Asana (unofficial)
5
5
  module Checkoff
6
6
  # Version of library
7
- VERSION = '0.233.0'
7
+ VERSION = '0.237.0'
8
8
  end