checkoff 0.33.2 → 0.34.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +1 -1
- data/checkoff.gemspec +1 -1
- data/fix.sh +11 -7
- data/lib/checkoff/clients.rb +2 -1
- data/lib/checkoff/tasks.rb +23 -9
- data/lib/checkoff/version.rb +1 -1
- data/lib/checkoff/workspaces.rb +7 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b31221009bc4a8eff20ae5ee62909ffd5391cdb7621ab30ca59ef196391588ad
|
4
|
+
data.tar.gz: 878750bf24c6587dce1380fcce8fb041f4b5d65db99d3e98cb836e9d8df7273c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0645801524c2e2e787277bc5b86bceda7b19899e870b6df54878d1ece0fee340ce72ca733be852c4035aca6333355ba9c0854cd6bdad6df634e7f537bb396b23'
|
7
|
+
data.tar.gz: 1d164eb6a946a0e8fe3be22461b70fa9d9720a69820c31867d78fc8f0d054758f6212d3f3de6f834480b9dba7db1179f367c22bac9fbb5585c7b8acfea9564e3
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/checkoff.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.summary = 'Command-line and gem client for Asana (unofficial)'
|
14
14
|
spec.homepage = 'https://github.com/apiology/checkoff'
|
15
15
|
spec.license = 'MIT license'
|
16
|
-
spec.required_ruby_version = '>=
|
16
|
+
spec.required_ruby_version = '>= 3.0'
|
17
17
|
|
18
18
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
19
19
|
`git ls-files -z`.split("\x0").reject do |f|
|
data/fix.sh
CHANGED
@@ -116,7 +116,7 @@ ensure_ruby_versions() {
|
|
116
116
|
|
117
117
|
# You can find out which feature versions are still supported / have
|
118
118
|
# been release here: https://www.ruby-lang.org/en/downloads/
|
119
|
-
ruby_versions="$(latest_ruby_version
|
119
|
+
ruby_versions="$(latest_ruby_version 3.0)"
|
120
120
|
|
121
121
|
echo "Latest Ruby versions: ${ruby_versions}"
|
122
122
|
|
@@ -134,6 +134,7 @@ ensure_ruby_versions() {
|
|
134
134
|
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install -s "${ver}"
|
135
135
|
else
|
136
136
|
rbenv install -s "${ver}"
|
137
|
+
hash -r # ensure we are seeing latest bundler etc
|
137
138
|
fi
|
138
139
|
done
|
139
140
|
}
|
@@ -152,10 +153,9 @@ ensure_bundle() {
|
|
152
153
|
#
|
153
154
|
# https://app.asana.com/0/1107901397356088/1199504270687298
|
154
155
|
|
155
|
-
# Version 2.2.22 of bundler
|
156
|
-
#
|
157
|
-
#
|
158
|
-
# bumping a gem version.
|
156
|
+
# Version <2.2.22 of bundler isn't compatible with Ruby 3.3:
|
157
|
+
#
|
158
|
+
# https://stackoverflow.com/questions/70800753/rails-calling-didyoumeanspell-checkers-mergeerror-name-spell-checker-h
|
159
159
|
need_better_bundler=false
|
160
160
|
if [ "${bundler_version_major}" -lt 2 ]
|
161
161
|
then
|
@@ -167,7 +167,7 @@ ensure_bundle() {
|
|
167
167
|
need_better_bundler=true
|
168
168
|
elif [ "${bundler_version_minor}" -eq 2 ]
|
169
169
|
then
|
170
|
-
if [ "${bundler_version_patch}" -lt
|
170
|
+
if [ "${bundler_version_patch}" -lt 23 ]
|
171
171
|
then
|
172
172
|
need_better_bundler=true
|
173
173
|
fi
|
@@ -175,7 +175,11 @@ ensure_bundle() {
|
|
175
175
|
fi
|
176
176
|
if [ "${need_better_bundler}" = true ]
|
177
177
|
then
|
178
|
-
|
178
|
+
# need to do this first before 'bundle update --bundler' will work
|
179
|
+
make bundle_install
|
180
|
+
bundle update --bundler
|
181
|
+
# ensure next step installs fresh bundle
|
182
|
+
rm -f Gemfile.lock.installed
|
179
183
|
fi
|
180
184
|
make bundle_install
|
181
185
|
# https://bundler.io/v2.0/bundle_lock.html#SUPPORTING-OTHER-PLATFORMS
|
data/lib/checkoff/clients.rb
CHANGED
@@ -27,7 +27,8 @@ module Checkoff
|
|
27
27
|
def client
|
28
28
|
@client ||= @asana_client_class.new do |c|
|
29
29
|
c.authentication :access_token, @config.fetch(:personal_access_token)
|
30
|
-
c.default_headers 'asana-enable' =>
|
30
|
+
c.default_headers 'asana-enable' =>
|
31
|
+
'new_project_templates,new_user_task_lists,new_memberships,new_goal_memberships'
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
data/lib/checkoff/tasks.rb
CHANGED
@@ -40,15 +40,13 @@ module Checkoff
|
|
40
40
|
# Pull a specific task by name
|
41
41
|
def task(workspace_name, project_name, task_name,
|
42
42
|
section_name: :unspecified,
|
43
|
-
only_uncompleted: true
|
44
|
-
|
45
|
-
tasks =
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
only_uncompleted: only_uncompleted)
|
51
|
-
end
|
43
|
+
only_uncompleted: true,
|
44
|
+
extra_fields: [])
|
45
|
+
tasks = tasks_from_section(workspace_name,
|
46
|
+
project_name,
|
47
|
+
section_name: section_name,
|
48
|
+
only_uncompleted: only_uncompleted,
|
49
|
+
extra_fields: extra_fields)
|
52
50
|
tasks.find { |task| task.name == task_name }
|
53
51
|
end
|
54
52
|
|
@@ -67,6 +65,22 @@ module Checkoff
|
|
67
65
|
|
68
66
|
private
|
69
67
|
|
68
|
+
def tasks_from_section(workspace_name, project_name,
|
69
|
+
section_name:,
|
70
|
+
only_uncompleted:,
|
71
|
+
extra_fields:)
|
72
|
+
if section_name == :unspecified
|
73
|
+
project = projects.project(workspace_name, project_name)
|
74
|
+
projects.tasks_from_project(project,
|
75
|
+
only_uncompleted: only_uncompleted,
|
76
|
+
extra_fields: extra_fields)
|
77
|
+
else
|
78
|
+
@sections.tasks(workspace_name, project_name, section_name,
|
79
|
+
only_uncompleted: only_uncompleted,
|
80
|
+
extra_fields: extra_fields)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
70
84
|
attr_reader :client
|
71
85
|
|
72
86
|
def projects
|
data/lib/checkoff/version.rb
CHANGED
data/lib/checkoff/workspaces.rb
CHANGED
@@ -18,9 +18,11 @@ module Checkoff
|
|
18
18
|
SHORT_CACHE_TIME = MINUTE
|
19
19
|
|
20
20
|
def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana),
|
21
|
-
client: Checkoff::Clients.new(config: config).client
|
21
|
+
client: Checkoff::Clients.new(config: config).client,
|
22
|
+
asana_workspace: Asana::Resources::Workspace)
|
22
23
|
@config = config
|
23
24
|
@client = client
|
25
|
+
@asana_workspace = asana_workspace
|
24
26
|
end
|
25
27
|
|
26
28
|
# Pulls an Asana workspace object
|
@@ -30,6 +32,10 @@ module Checkoff
|
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
35
|
+
def default_workspace
|
36
|
+
@asana_workspace.find_by_id(client, default_workspace_gid)
|
37
|
+
end
|
38
|
+
|
33
39
|
def workspace_or_raise(workspace_name)
|
34
40
|
workspace = workspace(workspace_name)
|
35
41
|
raise "Could not find workspace #{workspace_name}" if workspace.nil?
|
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.34.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-
|
11
|
+
date: 2023-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -447,14 +447,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
447
447
|
requirements:
|
448
448
|
- - ">="
|
449
449
|
- !ruby/object:Gem::Version
|
450
|
-
version: '
|
450
|
+
version: '3.0'
|
451
451
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
452
452
|
requirements:
|
453
453
|
- - ">="
|
454
454
|
- !ruby/object:Gem::Version
|
455
455
|
version: '0'
|
456
456
|
requirements: []
|
457
|
-
rubygems_version: 3.
|
457
|
+
rubygems_version: 3.2.33
|
458
458
|
signing_key:
|
459
459
|
specification_version: 4
|
460
460
|
summary: Command-line and gem client for Asana (unofficial)
|