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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/checkoff/projects.rb +1 -0
- data/lib/checkoff/tasks.rb +12 -2
- data/lib/checkoff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1695c4a845c22ee1bbdb6ffb62eb1c78b119867b06c1a004e713eab663f315f6
|
4
|
+
data.tar.gz: f55d3aeaf99ff74dba23349ff6b8bd388c92236236fcbc51f34416812b1c5a83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b24d4ebc9fb9d6f82eaf53ea5fa7cbc949dcf9d0df84e93e547c09d364bfe291c90e86222cd092eea0b68a3acae3943cde8225980ce9c4ae5eafd4719685605
|
7
|
+
data.tar.gz: b49d2c7e82b74159b0eec2105d27f91be60e58ecabc4c5074ca14d09f52381baec100d96a88f02eacaefb26447fab43e5df108c848d28c4598aab5f9b23320d3
|
data/Gemfile.lock
CHANGED
data/lib/checkoff/projects.rb
CHANGED
data/lib/checkoff/tasks.rb
CHANGED
@@ -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.
|
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
|
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
|
|
data/lib/checkoff/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|