checkoff 0.275.0 → 0.277.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: 0d1a98ed83f3d39bf0fa6c4fac31b5b123d7a46220b164251d76f6b3cf6408df
4
- data.tar.gz: 76da86f40184b64c0b2056ffe40ddf0417f6b6510134884dce46413a122cd539
3
+ metadata.gz: f613baf4711abca3969e780881eb74f6c24f6eb18d9a3fc94d2b8ef24e62602f
4
+ data.tar.gz: cc06bf3e44ceca22d5dba7201c00dab19e58e94f31a393645ad9ea961a2dc52b
5
5
  SHA512:
6
- metadata.gz: 75eb225b1f682bf8e03d203e62ba1904712eb24e977026e64aec086b83b9c0d8732088f3aeb6f82f16ea7d4568afdb155d6a4a319191c1cee6eb236eff370cc2
7
- data.tar.gz: 8e243128c13d5fc13f5075a410531a70fa4c086f9436bf7f435dce9604c7b3419ddd48b0326b94ff4de5043b8d35655fe730719b74583eb0f0fcdbe600d1d540
6
+ metadata.gz: 5ee4b9165ed6f44b9dbc15ebace09421451daa3068b6a3af97585f4f3e5cbb482039e075ad1ca9961d9586121637050a83c22319280a3d64f112580aa127d842
7
+ data.tar.gz: b09137b44206070323d38647ddacb69cc15dcc194005e0724c6619f4f20557b4349635b9d1457fc8a5313432d8c9ea21060419af128d9f604153b588539f5f7f
@@ -155,7 +155,7 @@ module Checkoff
155
155
  'resource_subtype' => 'external',
156
156
  'name' => attachment_name,
157
157
  }
158
- options = {}
158
+ options = {} #: Hash[Symbol, untyped]
159
159
  Asana::Resources::Attachment.new(parse(client.post('/attachments', body: with_params, options:)).first,
160
160
  client:)
161
161
  end
@@ -35,7 +35,7 @@ module Checkoff
35
35
  logger.debug { "Filtering using #{@filters.inspect}" }
36
36
  return true if @filters.nil?
37
37
 
38
- failures = []
38
+ failures = [] #: Array[untyped]
39
39
 
40
40
  @filters.any? do |filter|
41
41
  filter_matches = filter_matches_asana_event?(filter, asana_event, failures)
@@ -74,19 +74,20 @@ module Checkoff
74
74
  #
75
75
  # @return [Boolean]
76
76
  def asana_event_matches_filter_item?(key, value, asana_event)
77
+ no_hash = {} #: Hash[String, untyped]
77
78
  case key
78
79
  when 'resource_type'
79
- asana_event.fetch('resource', {})['resource_type'] == value
80
+ asana_event.fetch('resource', no_hash)['resource_type'] == value
80
81
  when 'resource_subtype'
81
- asana_event.fetch('resource', {})['resource_subtype'] == value
82
+ asana_event.fetch('resource', no_hash)['resource_subtype'] == value
82
83
  when 'action'
83
84
  asana_event['action'] == value
84
85
  when 'fields'
85
- value.include? asana_event.fetch('change', {})['field']
86
+ value.include? asana_event.fetch('change', no_hash)['field']
86
87
  when 'checkoff:parent.gid'
87
- asana_event.fetch('parent', {})['gid'] == value
88
+ asana_event.fetch('parent', no_hash)['gid'] == value
88
89
  when 'checkoff:resource.gid'
89
- asana_event.fetch('resource', {})['gid'] == value
90
+ asana_event.fetch('resource', no_hash)['gid'] == value
90
91
  when 'checkoff:fetched.section.gid'
91
92
  fields = ['memberships.project.gid', 'memberships.project.name',
92
93
  'memberships.section.name', 'assignee', 'assignee_section']
@@ -12,8 +12,9 @@ module Checkoff
12
12
  # @param config [Hash{Symbol => undefined}]
13
13
  # @param sym [Symbol]
14
14
  # @param yaml_filename [String]
15
- # @param env [RBS::Unnamed::ENVClass, Hash{String => String}]
16
- def initialize(config, sym, yaml_filename, env: ENV)
15
+ # @param env [Hash{String => String}, nil] read instead of ENV;
16
+ # ENV itself is never stored, so the loader stays marshalable
17
+ def initialize(config, sym, yaml_filename, env: nil)
17
18
  @config = config
18
19
  @envvar_prefix = sym.upcase
19
20
  @yaml_filename = yaml_filename
@@ -26,7 +27,7 @@ module Checkoff
26
27
  config_value = @config[key]
27
28
  return config_value unless config_value.nil?
28
29
 
29
- @env.fetch(envvar_name(key), nil)
30
+ (@env || ENV).fetch(envvar_name(key), nil)
30
31
  end
31
32
 
32
33
  # @param key [Symbol]
@@ -53,10 +54,10 @@ module Checkoff
53
54
  class << self
54
55
  # @param sym [Symbol]
55
56
  # @param filename [String]
56
- # @param env [RBS::Unnamed::ENVClass, Hash{String => String}]
57
+ # @param env [Hash{String => String}, nil] read instead of ENV
57
58
  #
58
59
  # @return [EnvFallbackConfigLoader]
59
- def load(sym, filename: yaml_filename(sym), env: ENV)
60
+ def load(sym, filename: yaml_filename(sym), env: nil)
60
61
  yaml_result = load_yaml_file(filename)
61
62
  EnvFallbackConfigLoader.new(yaml_result, sym, filename, env:)
62
63
  end
@@ -37,7 +37,7 @@ module Checkoff
37
37
  # }}}]
38
38
  def project_to_h(project_obj, project: :not_specified)
39
39
  project = project_obj.name if project == :not_specified
40
- project_hash = { **project_obj.to_h, 'project' => project }
40
+ project_hash = { **project_obj.to_h, 'project' => project } #: Hash[String, untyped]
41
41
  project_hash['unwrapped'] = {}
42
42
  unwrap_custom_fields(project_hash)
43
43
  project_hash
@@ -18,9 +18,9 @@ module Checkoff
18
18
  # @return [Array(Hash{String => String}, Array<Symbol, Array>)]
19
19
  def convert
20
20
  # @type args [Hash{String => String}]
21
- args = {}
21
+ args = {} #: Hash[String, String]
22
22
  # @type task_selector [Array<Symbol, Array>]
23
- task_selector = []
23
+ task_selector = [] #: Array[Symbol | Array[untyped]]
24
24
  by_custom_field.each do |gid, single_custom_field_params|
25
25
  new_args, new_task_selector = convert_single_custom_field_params(gid,
26
26
  single_custom_field_params)
@@ -61,7 +61,7 @@ module Checkoff
61
61
  # @return [Array(Hash{String => String}, Array<Array<String>,String>)]
62
62
  def convert
63
63
  max_value = fetch_solo_param("custom_field_#{gid}.max")
64
- empty_task_selector = []
64
+ empty_task_selector = [] #: Array[Array[String] | String]
65
65
  [{ "custom_fields.#{gid}.less_than" => max_value }, empty_task_selector]
66
66
  end
67
67
  end
@@ -71,7 +71,7 @@ module Checkoff
71
71
  # @return [Array(Hash{String => String}, Array<Array<String>,String>)]
72
72
  def convert
73
73
  max_value = fetch_solo_param("custom_field_#{gid}.min")
74
- empty_task_selector = []
74
+ empty_task_selector = [] #: Array[Array[String] | String]
75
75
  [{ "custom_fields.#{gid}.greater_than" => max_value }, empty_task_selector]
76
76
  end
77
77
  end
@@ -81,7 +81,7 @@ module Checkoff
81
81
  # @return [Array(Hash{String => String}, Array<Array<String>,String>)]
82
82
  def convert
83
83
  value = fetch_solo_param("custom_field_#{gid}.value")
84
- empty_task_selector = []
84
+ empty_task_selector = [] #: Array[Array[String] | String]
85
85
  [{ "custom_fields.#{gid}.value" => value }, empty_task_selector]
86
86
  end
87
87
  end
@@ -177,7 +177,7 @@ module Checkoff
177
177
  ensure_no_remaining_params!
178
178
 
179
179
  api_params = { "custom_fields.#{gid}.is_set" => 'true' }
180
- task_selector = []
180
+ task_selector = [] #: Array[Array[String] | String | Array[untyped]]
181
181
  [api_params, task_selector]
182
182
  end
183
183
  end
@@ -188,7 +188,7 @@ module Checkoff
188
188
  def convert
189
189
  selected_options = fetch_solo_param("custom_field_#{gid}.selected_options").split('~')
190
190
 
191
- empty_task_selector = []
191
+ empty_task_selector = [] #: Array[Array[String] | String | Array[untyped]]
192
192
  if selected_options.length == 1
193
193
  [{ "custom_fields.#{gid}.value" => selected_options.fetch(0) },
194
194
  empty_task_selector]
@@ -68,7 +68,8 @@ module Checkoff
68
68
  end
69
69
  end.transform_values(&:to_h),
70
70
  T::Hash[Symbol, T::Hash[String, T::Array[String]]])
71
- [groups.fetch(:custom_field, {}), groups.fetch(:date, {}), groups.fetch(:simple, {})]
71
+ no_params = {} #: Hash[String, Array[String]]
72
+ [groups.fetch(:custom_field, no_params), groups.fetch(:date, no_params), groups.fetch(:simple, no_params)]
72
73
  end
73
74
  end
74
75
  end
@@ -70,10 +70,10 @@ module Checkoff
70
70
  # @param verb [String]
71
71
  # @return [Array<String>]
72
72
  def convert_from_projects_and_sections(verb)
73
- projects = []
74
- sections = []
73
+ projects = [] #: Array[String]
74
+ sections = [] #: Array[String]
75
75
  parse_projects_and_sections(projects, sections)
76
- out = {}
76
+ out = {} #: Hash[String, String]
77
77
  out["projects.#{verb}"] = projects.join(',') unless projects.empty?
78
78
  out["sections.#{verb}"] = sections.join(',') unless sections.empty?
79
79
  out.to_a.flatten
@@ -35,7 +35,7 @@ module Checkoff
35
35
  # @param project [Asana::Resources::Project]
36
36
  # @param only_uncompleted [Boolean]
37
37
  # @param extra_fields [Array<String>]
38
- # @return [Hash{String => Enumerable<Asana::Resources::Task>}]
38
+ # @return [Hash{String, nil => Enumerable<Asana::Resources::Task>}]
39
39
  def tasks_by_section_for_my_tasks(project,
40
40
  only_uncompleted: true,
41
41
  extra_fields: [])
@@ -59,9 +59,9 @@ module Checkoff
59
59
  #
60
60
  # @param tasks [Enumerable<Asana::Resources::Task>]
61
61
  # @param project_gid [String]
62
- # @return [Hash{String => Enumerable<Asana::Resources::Task>}]
62
+ # @return [Hash{String, nil => Enumerable<Asana::Resources::Task>}]
63
63
  def by_my_tasks_section(tasks, project_gid)
64
- by_section = {}
64
+ by_section = {} #: Hash[String?, Array[Asana::Resources::Task]]
65
65
  sections = client.sections.get_sections_for_project(project_gid:,
66
66
  options: { fields: ['name'] })
67
67
  sections.each_entry { |section| by_section[section_key(section.name)] = [] }
@@ -204,7 +204,7 @@ module Checkoff
204
204
  #
205
205
  # @return [Asana::Resources::Section, nil]
206
206
  def section_by_gid(gid)
207
- options = {}
207
+ options = {} #: Hash[Symbol, untyped]
208
208
  Asana::Resources::Section.new(parse(client.get("/sections/#{gid}", options:)).first,
209
209
  client:)
210
210
  rescue Asana::Errors::NotFound => e
@@ -287,7 +287,7 @@ module Checkoff
287
287
  # @param project_gid [String]
288
288
  # @return [Hash{String, nil => Enumerable<Asana::Resources::Task>}]
289
289
  def by_section(tasks, project_gid)
290
- by_section = {}
290
+ by_section = {} #: Hash[String?, Array[Asana::Resources::Task]]
291
291
  sections = client.sections.get_sections_for_project(project_gid:,
292
292
  options: { fields: ['name'] })
293
293
  sections.each_entry { |section| by_section[section_key(section.name)] = [] }
@@ -44,7 +44,7 @@ module Checkoff
44
44
  # @return [Hash{nil,String => Enumerable<Asana::Resources::Task>}]
45
45
  def by_section(tasks)
46
46
  current_section = nil
47
- by_section = { nil => [] }
47
+ by_section = { nil => [] } #: Hash[String?, Array[Asana::Resources::Task]]
48
48
  tasks.each do |task|
49
49
  current_section, by_section = file_task_by_section(current_section,
50
50
  by_section, task)
@@ -75,7 +75,8 @@ module Checkoff
75
75
  # @type [Hash{Symbol => undefined}]
76
76
  all_options = projects.task_options(extra_fields: extra_fields + %w[is_rendered_as_separator],
77
77
  only_uncompleted:)
78
- options = all_options.fetch(:options, {})
78
+ no_options = {} #: Hash[Symbol, untyped]
79
+ options = all_options.fetch(:options, no_options)
79
80
  client.tasks.get_subtasks_for_task(task_gid:,
80
81
  # per_page: 100, # stub doesn't have this arg available
81
82
  options:)
@@ -150,7 +150,7 @@ module Checkoff
150
150
  # @return [Enumerable<Asana::Resources::Task>]
151
151
  def iterated_raw_task_search(api_params, workspace_gid:, extra_fields:)
152
152
  # https://developers.asana.com/reference/searchtasksforworkspace
153
- tasks = []
153
+ tasks = [] #: Array[Asana::Resources::Task]
154
154
  new_api_params = api_params.dup
155
155
  original_sort_by = new_api_params.delete('sort_by')
156
156
  # defaults to false
@@ -164,8 +164,9 @@ module Checkoff
164
164
  only_uncompleted: true)
165
165
  all_options = projects.task_options(extra_fields:,
166
166
  only_uncompleted:)
167
+ no_options = {} #: Hash[Symbol, untyped]
167
168
  # @type [Hash]
168
- options = all_options.fetch(:options) { {} }
169
+ options = all_options.fetch(:options) { no_options }
169
170
  options[:completed_since] = all_options[:completed_since] unless all_options[:completed_since].nil?
170
171
  client.tasks.find_by_id(task_gid, options:)
171
172
  rescue Asana::Errors::NotFound => e
@@ -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.275.0'
7
+ VERSION = '0.277.0'
8
8
  end
data/rbi/checkoff.rbi CHANGED
@@ -82,7 +82,7 @@ module Overcommit
82
82
  end
83
83
 
84
84
  module Checkoff
85
- VERSION = '0.275.0'
85
+ VERSION = '0.277.0'
86
86
 
87
87
  class Attachments
88
88
  include Logging
@@ -1634,7 +1634,7 @@ module Checkoff
1634
1634
  env: T.untyped
1635
1635
  ).void
1636
1636
  end
1637
- def initialize(config, sym, yaml_filename, env: ENV); end
1637
+ def initialize(config, sym, yaml_filename, env: nil); end
1638
1638
 
1639
1639
  sig { params(key: T.untyped).returns(T.untyped) }
1640
1640
  def [](key); end
@@ -1648,7 +1648,7 @@ module Checkoff
1648
1648
 
1649
1649
  class ConfigLoader
1650
1650
  sig { params(sym: T.untyped, filename: T.untyped, env: T.untyped).returns(T.untyped) }
1651
- def self.load(sym, filename: yaml_filename(sym), env: ENV); end
1651
+ def self.load(sym, filename: yaml_filename(sym), env: nil); end
1652
1652
 
1653
1653
  sig { params(filename: T.untyped).returns(T.untyped) }
1654
1654
  def self.load_yaml_file(filename); end
@@ -2572,7 +2572,7 @@ end
2572
2572
  # typed: ignore
2573
2573
  # Command-line and gem client for Asana (unofficial)
2574
2574
  module Checkoff
2575
- VERSION = T.let('0.275.0', T.untyped)
2575
+ VERSION = T.let('0.277.0', T.untyped)
2576
2576
 
2577
2577
  # Move tasks from one place to another
2578
2578
  class MvSubcommand
@@ -3523,7 +3523,7 @@ module Checkoff
3523
3523
  # _@param_ `only_uncompleted`
3524
3524
  #
3525
3525
  # _@param_ `extra_fields`
3526
- sig { params(project: Asana::Resources::Project, only_uncompleted: T::Boolean, extra_fields: T::Array[String]).returns(T::Hash[String, T::Enumerable[Asana::Resources::Task]]) }
3526
+ sig { params(project: Asana::Resources::Project, only_uncompleted: T::Boolean, extra_fields: T::Array[String]).returns(T::Hash[T.nilable(String), T::Enumerable[Asana::Resources::Task]]) }
3527
3527
  def tasks_by_section_for_my_tasks(project, only_uncompleted: true, extra_fields: []); end
3528
3528
 
3529
3529
  # _@param_ `name`
@@ -3536,7 +3536,7 @@ module Checkoff
3536
3536
  # _@param_ `tasks`
3537
3537
  #
3538
3538
  # _@param_ `project_gid`
3539
- sig { params(tasks: T::Enumerable[Asana::Resources::Task], project_gid: String).returns(T::Hash[String, T::Enumerable[Asana::Resources::Task]]) }
3539
+ sig { params(tasks: T::Enumerable[Asana::Resources::Task], project_gid: String).returns(T::Hash[T.nilable(String), T::Enumerable[Asana::Resources::Task]]) }
3540
3540
  def by_my_tasks_section(tasks, project_gid); end
3541
3541
 
3542
3542
  sig { returns(Checkoff::Projects) }
@@ -5053,16 +5053,16 @@ module Checkoff
5053
5053
  #
5054
5054
  # _@param_ `yaml_filename`
5055
5055
  #
5056
- # _@param_ `env`
5056
+ # _@param_ `env` — read instead of ENV; ENV itself is never stored, so the loader stays marshalable
5057
5057
  sig do
5058
5058
  params(
5059
5059
  config: T::Hash[Symbol, T.untyped],
5060
5060
  sym: Symbol,
5061
5061
  yaml_filename: String,
5062
- env: T.any(RBS::Unnamed::ENVClass, T::Hash[String, String])
5062
+ env: T.nilable(T::Hash[String, String])
5063
5063
  ).void
5064
5064
  end
5065
- def initialize(config, sym, yaml_filename, env: ENV); end
5065
+ def initialize(config, sym, yaml_filename, env: nil); end
5066
5066
 
5067
5067
  # _@param_ `key`
5068
5068
  sig { params(key: Symbol).returns(T.nilable(Object)) }
@@ -5083,9 +5083,9 @@ module Checkoff
5083
5083
  #
5084
5084
  # _@param_ `filename`
5085
5085
  #
5086
- # _@param_ `env`
5087
- sig { params(sym: Symbol, filename: String, env: T.any(RBS::Unnamed::ENVClass, T::Hash[String, String])).returns(EnvFallbackConfigLoader) }
5088
- def self.load(sym, filename: yaml_filename(sym), env: ENV); end
5086
+ # _@param_ `env` — read instead of ENV
5087
+ sig { params(sym: Symbol, filename: String, env: T.nilable(T::Hash[String, String])).returns(EnvFallbackConfigLoader) }
5088
+ def self.load(sym, filename: yaml_filename(sym), env: nil); end
5089
5089
 
5090
5090
  # _@param_ `filename`
5091
5091
  sig { params(filename: String).returns(T::Hash[Symbol, T.untyped]) }
data/sig/checkoff.rbs CHANGED
@@ -786,7 +786,7 @@ module Checkoff
786
786
  # _@param_ `only_uncompleted`
787
787
  #
788
788
  # _@param_ `extra_fields`
789
- def tasks_by_section_for_my_tasks: (Asana::Resources::Project project, ?only_uncompleted: bool, ?extra_fields: ::Array[String]) -> ::Hash[String, ::Enumerable[Asana::Resources::Task]]
789
+ def tasks_by_section_for_my_tasks: (Asana::Resources::Project project, ?only_uncompleted: bool, ?extra_fields: ::Array[String]) -> ::Hash[String?, ::Enumerable[Asana::Resources::Task]]
790
790
 
791
791
  # _@param_ `name`
792
792
  def section_key: (String? name) -> String?
@@ -797,7 +797,7 @@ module Checkoff
797
797
  # _@param_ `tasks`
798
798
  #
799
799
  # _@param_ `project_gid`
800
- def by_my_tasks_section: (::Enumerable[Asana::Resources::Task] tasks, String project_gid) -> ::Hash[String, ::Enumerable[Asana::Resources::Task]]
800
+ def by_my_tasks_section: (::Enumerable[Asana::Resources::Task] tasks, String project_gid) -> ::Hash[String?, ::Enumerable[Asana::Resources::Task]]
801
801
 
802
802
  attr_reader projects: Checkoff::Projects
803
803
 
@@ -2063,12 +2063,12 @@ module Checkoff
2063
2063
  #
2064
2064
  # _@param_ `yaml_filename`
2065
2065
  #
2066
- # _@param_ `env`
2066
+ # _@param_ `env` — read instead of ENV; ENV itself is never stored, so the loader stays marshalable
2067
2067
  def initialize: (
2068
2068
  ::Hash[Symbol, untyped] config,
2069
2069
  Symbol sym,
2070
2070
  String yaml_filename,
2071
- ?env: (RBS::Unnamed::ENVClass | ::Hash[String, String])
2071
+ ?env: ::Hash[String, String]?
2072
2072
  ) -> void
2073
2073
 
2074
2074
  # _@param_ `key`
@@ -2087,8 +2087,8 @@ module Checkoff
2087
2087
  #
2088
2088
  # _@param_ `filename`
2089
2089
  #
2090
- # _@param_ `env`
2091
- def self.load: (Symbol sym, ?filename: String, ?env: (RBS::Unnamed::ENVClass | ::Hash[String, String])) -> EnvFallbackConfigLoader
2090
+ # _@param_ `env` — read instead of ENV
2091
+ def self.load: (Symbol sym, ?filename: String, ?env: ::Hash[String, String]?) -> EnvFallbackConfigLoader
2092
2092
 
2093
2093
  # _@param_ `filename`
2094
2094
  def self.load_yaml_file: (String filename) -> ::Hash[Symbol, untyped]
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.275.0
4
+ version: 0.277.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: 2026-11-13 00:00:00.000000000 Z
11
+ date: 2026-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport