checkoff 0.121.0 → 0.123.0
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 +14 -2
- data/lib/checkoff/timelines.rb +6 -6
- 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: 339b4006d044f90c9603f62dbd4da0dc12168ad1b07ca9ff6495a45881bba3a2
|
4
|
+
data.tar.gz: 01bf6d4beee4ffedbf7f858b221a9594d7a21e907bd0ac92774e2c4dd657ceaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7145d5e1c364b297c1e8610983b32d29f281cbf095ebabdb3b0d7a1cb20fe87f72f3bdb9eee2673a844a43d48d9c1e0b17f81cc29aaf3e4f12984ba21b01ec72
|
7
|
+
data.tar.gz: 799447a0c2695cd0588d0f10ed6807e4ac6411fb86a9200532ca9bae6cb654dc2c6df7848d05e1bd26bffbcf79cf2d20fccb6ac31bd8ede93c98c9ab1fbd4762
|
data/Gemfile.lock
CHANGED
data/lib/checkoff/projects.rb
CHANGED
@@ -60,6 +60,7 @@ module Checkoff
|
|
60
60
|
# @param [String] workspace_name
|
61
61
|
# @param [String] project_name
|
62
62
|
# @param [Array<String>] extra_fields
|
63
|
+
#
|
63
64
|
# @return [Asana::Resources::Project, nil]
|
64
65
|
def project(workspace_name, project_name, extra_fields: [])
|
65
66
|
if project_name.is_a?(Symbol) && project_name.to_s.start_with?('my_tasks')
|
@@ -76,15 +77,26 @@ module Checkoff
|
|
76
77
|
|
77
78
|
# @param workspace_name [String]
|
78
79
|
# @param project_name [String]
|
80
|
+
# @param [Array<String>] extra_fields
|
81
|
+
#
|
79
82
|
# @return [Asana::Resources::Project]
|
80
|
-
def project_or_raise(workspace_name, project_name)
|
81
|
-
p = project(workspace_name, project_name)
|
83
|
+
def project_or_raise(workspace_name, project_name, extra_fields: [])
|
84
|
+
p = project(workspace_name, project_name, extra_fields: extra_fields)
|
82
85
|
raise "Could not find project #{project_name.inspect} under workspace #{workspace_name}." if p.nil?
|
83
86
|
|
84
87
|
p
|
85
88
|
end
|
86
89
|
cache_method :project_or_raise, LONG_CACHE_TIME
|
87
90
|
|
91
|
+
# @param gid [String]
|
92
|
+
# @param [Array<String>] extra_fields
|
93
|
+
#
|
94
|
+
# @return [Asana::Resources::Project]
|
95
|
+
def project_by_gid(gid, extra_fields: [])
|
96
|
+
projects.find_by_id(gid, options: { fields: %w[name] + extra_fields })
|
97
|
+
end
|
98
|
+
cache_method :project_or_raise, LONG_CACHE_TIME
|
99
|
+
|
88
100
|
# find uncompleted tasks in a list
|
89
101
|
# @param [Enumerable<Asana::Resources::Task>] tasks
|
90
102
|
# @return [Enumerable<Asana::Resources::Task>]
|
data/lib/checkoff/timelines.rb
CHANGED
@@ -108,16 +108,16 @@ module Checkoff
|
|
108
108
|
#
|
109
109
|
# @return [Boolean]
|
110
110
|
def task_data_dependent_on_previous_section_last_milestone?(task_data, section)
|
111
|
-
# @sg-ignore
|
112
|
-
# @type [Array<Hash{String => String}>]
|
113
|
-
dependencies = task_data.fetch('dependencies')
|
114
|
-
return false if dependencies.empty?
|
115
|
-
|
116
111
|
previous_section = @sections.previous_section(section)
|
117
112
|
return false if previous_section.nil?
|
118
113
|
|
119
114
|
previous_section_last_milestone = last_milestone_in_section(previous_section.gid)
|
120
|
-
return
|
115
|
+
return true if previous_section_last_milestone.nil?
|
116
|
+
|
117
|
+
# @sg-ignore
|
118
|
+
# @type [Array<Hash{String => String}>]
|
119
|
+
dependencies = task_data.fetch('dependencies')
|
120
|
+
return false if dependencies.empty?
|
121
121
|
|
122
122
|
dependencies.any? { |dependency| dependency.fetch('gid') == previous_section_last_milestone.gid }
|
123
123
|
end
|
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.
|
4
|
+
version: 0.123.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-11-
|
11
|
+
date: 2023-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|