checkoff 0.36.0 → 0.36.1

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: 35f3eede428605d10e3c90de0dc50b5a586175314977a6a54e8187f5b22b9226
4
- data.tar.gz: '0086906e61829987635d676c9c595dd7665473adf033c10f05a9de1b613b2502'
3
+ metadata.gz: 1695c4a845c22ee1bbdb6ffb62eb1c78b119867b06c1a004e713eab663f315f6
4
+ data.tar.gz: f55d3aeaf99ff74dba23349ff6b8bd388c92236236fcbc51f34416812b1c5a83
5
5
  SHA512:
6
- metadata.gz: 620f38dbfdfe18677e6d821dc2fe9b04a298b35ff7fb305eee2aed2deb079b2ba216b8490a505f6a24300d204afe58c9ae516d7f18d6f29c47c151a01513bd65
7
- data.tar.gz: 32cbc3c60d7971916609ddeb3f494a7a8cd0a0ef54f6a9760462e4ef14d2f34a82aaec4462e866ca8fb8108c7aff5a37b30fdb551c649f9d1586f86be4bce4a6
6
+ metadata.gz: 6b24d4ebc9fb9d6f82eaf53ea5fa7cbc949dcf9d0df84e93e547c09d364bfe291c90e86222cd092eea0b68a3acae3943cde8225980ce9c4ae5eafd4719685605
7
+ data.tar.gz: b49d2c7e82b74159b0eec2105d27f91be60e58ecabc4c5074ca14d09f52381baec100d96a88f02eacaefb26447fab43e5df108c848d28c4598aab5f9b23320d3
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GIT
12
12
  PATH
13
13
  remote: .
14
14
  specs:
15
- checkoff (0.36.0)
15
+ checkoff (0.36.1)
16
16
  activesupport
17
17
  asana (> 0.10.0)
18
18
  cache_method
@@ -33,6 +33,7 @@ module Checkoff
33
33
  end
34
34
 
35
35
  # Default options used in Asana API to pull taskso
36
+ # @return [Hash]
36
37
  def task_options
37
38
  {
38
39
  per_page: 100,
@@ -3,6 +3,7 @@
3
3
  # frozen_string_literal: true
4
4
 
5
5
  require_relative 'sections'
6
+ require 'asana'
6
7
 
7
8
  module Checkoff
8
9
  # Pull tasks from Asana
@@ -14,6 +15,7 @@ module Checkoff
14
15
  LONG_CACHE_TIME = MINUTE * 15
15
16
  SHORT_CACHE_TIME = MINUTE * 5
16
17
 
18
+ # @param sections [Checkoff::Sections]
17
19
  def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
18
20
  client: Checkoff::Clients.new(config: config).client,
19
21
  sections: Checkoff::Sections.new(config: config,
@@ -38,6 +40,7 @@ module Checkoff
38
40
  end
39
41
 
40
42
  # Pull a specific task by name
43
+ # @return [Asana::Resources::Task, nil]
41
44
  def task(workspace_name, project_name, task_name,
42
45
  section_name: :unspecified,
43
46
  only_uncompleted: true,
@@ -50,6 +53,7 @@ module Checkoff
50
53
  tasks.find { |task| task.name == task_name }
51
54
  end
52
55
 
56
+ # @return [Asana::Resources::Task]
53
57
  def add_task(name,
54
58
  workspace_gid: default_workspace_gid,
55
59
  assignee_gid: default_assignee_gid)
@@ -65,12 +69,13 @@ module Checkoff
65
69
 
66
70
  private
67
71
 
72
+ # @return [Array<Asana::Resources::Task>]
68
73
  def tasks_from_section(workspace_name, project_name,
69
74
  section_name:,
70
75
  only_uncompleted:,
71
76
  extra_fields:)
72
77
  if section_name == :unspecified
73
- project = projects.project(workspace_name, project_name)
78
+ project = projects.project_or_raise(workspace_name, project_name)
74
79
  projects.tasks_from_project(project,
75
80
  only_uncompleted: only_uncompleted,
76
81
  extra_fields: extra_fields)
@@ -83,10 +88,12 @@ module Checkoff
83
88
 
84
89
  attr_reader :client
85
90
 
91
+ # @return [Checkoff::Projects]
86
92
  def projects
87
93
  @projects ||= @sections.projects
88
94
  end
89
95
 
96
+ # @return [String]
90
97
  def default_assignee_gid
91
98
  @config.fetch(:default_assignee_gid)
92
99
  end
@@ -99,13 +106,16 @@ module Checkoff
99
106
  end
100
107
 
101
108
  def incomplete_dependencies?(task)
102
- # Avoid a reundant fetch. Unfortunately, Ruby SDK allows
109
+ # Avoid a redundant fetch. Unfortunately, Ruby SDK allows
103
110
  # dependencies to be fetched along with other attributes--but
104
111
  # then doesn't use it and does another HTTP GET! At least this
105
112
  # way we can skip the extra HTTP GET in the common case when
106
113
  # there are no dependencies.
107
114
  #
108
115
  # https://github.com/Asana/ruby-asana/issues/125
116
+
117
+ # @sg-ignore
118
+ # @type [Array<Asana::Resources::Task>, nil]
109
119
  already_fetched_dependencies = task.instance_variable_get(:@dependencies)
110
120
  return false unless already_fetched_dependencies.nil? || already_fetched_dependencies.size.positive?
111
121
 
@@ -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.36.0'
6
+ VERSION = '0.36.1'
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.36.0
4
+ version: 0.36.1
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-05-19 00:00:00.000000000 Z
11
+ date: 2023-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport