checkoff 0.15.2 → 0.16.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 +4 -4
- data/.circleci/config.yml +2 -0
- data/.envrc +2 -1
- data/.gitattributes +6 -0
- data/.gitignore +3 -0
- data/.overcommit.yml +2 -0
- data/.rubocop.yml +1 -0
- data/DEVELOPMENT.md +30 -0
- data/Gemfile.lock +9 -9
- data/Makefile +4 -1
- data/coverage/.last_run.json +1 -1
- data/fix.sh +8 -4
- data/lib/checkoff/clients.rb +1 -2
- data/lib/checkoff/my_tasks.rb +46 -0
- data/lib/checkoff/sections.rb +11 -4
- data/lib/checkoff/version.rb +1 -1
- data/requirements_dev.txt +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6077fb7e61bc4ca3d3853df3df9aa8321e1638b413c2913eec541e8ae94defe7
|
|
4
|
+
data.tar.gz: 809c7d2cb26099cef0816719f9cf3491e179d8a8c44b3b1e72d51af46ae98a85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8ed5e0dadd2384438b286d0f53a306d1e9f67b6253531e7f19f7809cdc59849b3562ea45d858c87725a532a2305650c5291d057545432a5e0eeeefc9060e9d0
|
|
7
|
+
data.tar.gz: b1f75a997bda89f8aaca31e1049f74a08d81da53f0495325503dba3114910daf5b9d8c4ae9fbc1428fece772253fb7dc2510708f61cdf7fa877b8a4df71e34e0
|
data/.circleci/config.yml
CHANGED
|
@@ -110,6 +110,8 @@ jobs:
|
|
|
110
110
|
git status --porcelain coverage/.last_run.json
|
|
111
111
|
git diff coverage/.last_run.json
|
|
112
112
|
test -z "$(git status --porcelain coverage/.last_run.json)"
|
|
113
|
+
# This seemed to shave 5ish% of the build time off when added
|
|
114
|
+
resource_class: large
|
|
113
115
|
|
|
114
116
|
workflows:
|
|
115
117
|
version: 2
|
data/.envrc
CHANGED
data/.gitattributes
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# there's a lot of .sh in the build machinery; this can overwhelm
|
|
2
|
+
# smaller projects and confuse GitHub's detection of majority project
|
|
3
|
+
# type (GitHub uses the linguist library)
|
|
4
|
+
#
|
|
5
|
+
# https://dev.to/katkelly/changing-your-repo-s-language-in-github-5gjo
|
|
6
|
+
*.sh linguist-detectable=false
|
data/.gitignore
CHANGED
data/.overcommit.yml
CHANGED
data/.rubocop.yml
CHANGED
data/DEVELOPMENT.md
CHANGED
|
@@ -16,6 +16,36 @@ quality checks. `bundle exec overcommit --install` will install it.
|
|
|
16
16
|
This project uses direnv to manage environment variables used during
|
|
17
17
|
development. See the `.envrc` file for detail.
|
|
18
18
|
|
|
19
|
+
## cache_method
|
|
20
|
+
|
|
21
|
+
Checkoff uses the
|
|
22
|
+
[`cache_method`](https://github.com/seamusabshere/cache_method) gem to
|
|
23
|
+
cache results between invocations. Configuration details can be found
|
|
24
|
+
[here](https://github.com/seamusabshere/cache_method#configuration-and-supported-cache-clients).
|
|
25
|
+
By default a memcached client on the default port (11211) on the host
|
|
26
|
+
`memcached` will be used.
|
|
27
|
+
|
|
28
|
+
You can run memcached locally on macOS with Homebrew by running:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
brew install memcached
|
|
32
|
+
brew services start memcached
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
You may want to add a `memcached` alias for `127.0.0.1` in `/etc/hosts`.
|
|
36
|
+
|
|
37
|
+
Please make sure this is only listening on loopback for security, of course.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## gli
|
|
41
|
+
|
|
42
|
+
Checkoff uses [`gli`](https://github.com/davetron5000/gli) on the CLI.
|
|
43
|
+
To get a full stack trace when encountering a problem, run as follows:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
GLI_DEBUG=true checkoff your-arguments-here
|
|
47
|
+
```
|
|
48
|
+
|
|
19
49
|
## Publishing
|
|
20
50
|
|
|
21
51
|
To publish new version as a maintainer:
|
data/Gemfile.lock
CHANGED
|
@@ -12,7 +12,7 @@ GIT
|
|
|
12
12
|
PATH
|
|
13
13
|
remote: .
|
|
14
14
|
specs:
|
|
15
|
-
checkoff (0.
|
|
15
|
+
checkoff (0.16.0)
|
|
16
16
|
activesupport
|
|
17
17
|
asana (> 0.10.0)
|
|
18
18
|
cache_method
|
|
@@ -22,7 +22,7 @@ PATH
|
|
|
22
22
|
GEM
|
|
23
23
|
remote: https://rubygems.org/
|
|
24
24
|
specs:
|
|
25
|
-
activesupport (6.1.
|
|
25
|
+
activesupport (6.1.5.1)
|
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
27
27
|
i18n (>= 1.6, < 2)
|
|
28
28
|
minitest (>= 5.1)
|
|
@@ -35,8 +35,8 @@ GEM
|
|
|
35
35
|
cache (>= 0.2.1)
|
|
36
36
|
childprocess (4.0.0)
|
|
37
37
|
coderay (1.1.3)
|
|
38
|
-
concurrent-ruby (1.1.
|
|
39
|
-
dalli (2.
|
|
38
|
+
concurrent-ruby (1.1.10)
|
|
39
|
+
dalli (3.2.1)
|
|
40
40
|
docile (1.4.0)
|
|
41
41
|
faraday (1.5.1)
|
|
42
42
|
faraday-em_http (~> 1.0)
|
|
@@ -60,15 +60,15 @@ GEM
|
|
|
60
60
|
faraday_middleware-multi_json (0.0.6)
|
|
61
61
|
faraday_middleware
|
|
62
62
|
multi_json
|
|
63
|
-
gli (2.
|
|
64
|
-
i18n (1.
|
|
63
|
+
gli (2.21.0)
|
|
64
|
+
i18n (1.10.0)
|
|
65
65
|
concurrent-ruby (~> 1.0)
|
|
66
66
|
imagen (0.1.8)
|
|
67
67
|
parser (>= 2.5, != 2.5.1.1)
|
|
68
68
|
iniparse (1.5.0)
|
|
69
69
|
jwt (2.2.3)
|
|
70
70
|
method_source (1.0.0)
|
|
71
|
-
minitest (5.
|
|
71
|
+
minitest (5.15.0)
|
|
72
72
|
minitest-profile (0.0.2)
|
|
73
73
|
mocha (1.12.0)
|
|
74
74
|
multi_json (1.15.0)
|
|
@@ -127,7 +127,7 @@ GEM
|
|
|
127
127
|
rainbow (>= 2.1, < 4.0)
|
|
128
128
|
rugged (>= 0.27, < 1.2)
|
|
129
129
|
unicode-display_width (2.0.0)
|
|
130
|
-
zeitwerk (2.4
|
|
130
|
+
zeitwerk (2.5.4)
|
|
131
131
|
|
|
132
132
|
PLATFORMS
|
|
133
133
|
ruby
|
|
@@ -153,4 +153,4 @@ DEPENDENCIES
|
|
|
153
153
|
undercover
|
|
154
154
|
|
|
155
155
|
BUNDLED WITH
|
|
156
|
-
2.2.
|
|
156
|
+
2.2.25
|
data/Makefile
CHANGED
|
@@ -15,7 +15,7 @@ export PRINT_HELP_PYSCRIPT
|
|
|
15
15
|
help:
|
|
16
16
|
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
|
|
17
17
|
|
|
18
|
-
default: localtest ## run default
|
|
18
|
+
default: localtest ## run default tests and quality
|
|
19
19
|
|
|
20
20
|
requirements_dev.txt.installed: requirements_dev.txt
|
|
21
21
|
pip install -q --disable-pip-version-check -r requirements_dev.txt
|
|
@@ -50,6 +50,9 @@ test: ## Run lower-level tests
|
|
|
50
50
|
localtest: ## run default local actions
|
|
51
51
|
@bundle exec rake localtest
|
|
52
52
|
|
|
53
|
+
repl: ## Load up checkoff in pry
|
|
54
|
+
@bundle exec rake repl
|
|
55
|
+
|
|
53
56
|
update_from_cookiecutter: ## Bring in changes from template project used to create this repo
|
|
54
57
|
bundle exec overcommit --uninstall
|
|
55
58
|
IN_COOKIECUTTER_PROJECT_UPGRADER=1 cookiecutter_project_upgrader || true
|
data/coverage/.last_run.json
CHANGED
data/fix.sh
CHANGED
|
@@ -7,7 +7,7 @@ apt_upgraded=0
|
|
|
7
7
|
update_apt() {
|
|
8
8
|
if [ "${apt_upgraded}" = 0 ]
|
|
9
9
|
then
|
|
10
|
-
sudo apt-get update -y
|
|
10
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
|
|
11
11
|
apt_upgraded=1
|
|
12
12
|
fi
|
|
13
13
|
}
|
|
@@ -243,7 +243,7 @@ install_package() {
|
|
|
243
243
|
elif type apt-get >/dev/null 2>&1
|
|
244
244
|
then
|
|
245
245
|
update_apt
|
|
246
|
-
sudo apt-get install -y "${apt_package}"
|
|
246
|
+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y "${apt_package}"
|
|
247
247
|
else
|
|
248
248
|
>&2 echo "Teach me how to install packages on this plaform"
|
|
249
249
|
exit 1
|
|
@@ -257,7 +257,7 @@ ensure_python_build_requirements() {
|
|
|
257
257
|
ensure_dev_library ffi.h libffi libffi-dev
|
|
258
258
|
ensure_dev_library sqlite3.h sqlite3 libsqlite3-dev
|
|
259
259
|
ensure_dev_library lzma.h xz liblzma-dev
|
|
260
|
-
ensure_dev_library readline.h readline libreadline-dev
|
|
260
|
+
ensure_dev_library readline/readline.h readline libreadline-dev
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
# You can find out which feature versions are still supported / have
|
|
@@ -275,8 +275,12 @@ ensure_python_versions() {
|
|
|
275
275
|
do
|
|
276
276
|
if [ "$(uname)" == Darwin ]
|
|
277
277
|
then
|
|
278
|
+
if [ -z "${HOMEBREW_OPENSSL_PREFIX:-}" ]
|
|
279
|
+
then
|
|
280
|
+
HOMEBREW_OPENSSL_PREFIX="$(brew --prefix openssl)"
|
|
281
|
+
fi
|
|
278
282
|
pyenv_install() {
|
|
279
|
-
CFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include" LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib" pyenv install --skip-existing "$@"
|
|
283
|
+
CFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I${HOMEBREW_OPENSSL_PREFIX}/include" LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib -L${HOMEBREW_OPENSSL_PREFIX}/lib" pyenv install --skip-existing "$@"
|
|
280
284
|
}
|
|
281
285
|
|
|
282
286
|
major_minor="$(cut -d. -f1-2 <<<"${ver}")"
|
data/lib/checkoff/clients.rb
CHANGED
|
@@ -27,8 +27,7 @@ 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' => '
|
|
31
|
-
c.default_headers 'asana-disable' => 'new_user_task_lists'
|
|
30
|
+
c.default_headers 'asana-enable' => 'new_project_templates'
|
|
32
31
|
end
|
|
33
32
|
end
|
|
34
33
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'forwardable'
|
|
4
|
+
require_relative 'projects'
|
|
5
|
+
require_relative 'workspaces'
|
|
6
|
+
require_relative 'clients'
|
|
7
|
+
|
|
8
|
+
module Checkoff
|
|
9
|
+
# Query different sections of Asana 'My Tasks' projects
|
|
10
|
+
class MyTasks
|
|
11
|
+
MINUTE = 60
|
|
12
|
+
LONG_CACHE_TIME = MINUTE * 15
|
|
13
|
+
SHORT_CACHE_TIME = MINUTE * 5
|
|
14
|
+
|
|
15
|
+
attr_reader :projects
|
|
16
|
+
|
|
17
|
+
def initialize(config: Checkoff::ConfigLoader.load(:asana),
|
|
18
|
+
projects: Checkoff::Projects.new(config: config))
|
|
19
|
+
@config = config
|
|
20
|
+
@projects = projects
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Given a 'My Tasks' project object, pull all tasks, then provide
|
|
24
|
+
# a Hash of tasks with section name -> task list of the
|
|
25
|
+
# uncompleted tasks.
|
|
26
|
+
def tasks_by_section_for_my_tasks(project)
|
|
27
|
+
raw_tasks = projects.tasks_from_project(project,
|
|
28
|
+
extra_fields: ['assignee_section.name'])
|
|
29
|
+
active_tasks = projects.active_tasks(raw_tasks)
|
|
30
|
+
by_my_tasks_section(active_tasks)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Given a list of tasks in 'My Tasks', pull a Hash of tasks with
|
|
34
|
+
# section name -> task list
|
|
35
|
+
def by_my_tasks_section(tasks)
|
|
36
|
+
by_section = {}
|
|
37
|
+
tasks.each do |task|
|
|
38
|
+
assignee_section = task.assignee_section
|
|
39
|
+
current_section = assignee_section.name
|
|
40
|
+
by_section[current_section] ||= []
|
|
41
|
+
by_section[current_section] << task
|
|
42
|
+
end
|
|
43
|
+
by_section
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/lib/checkoff/sections.rb
CHANGED
|
@@ -4,6 +4,7 @@ require 'forwardable'
|
|
|
4
4
|
require_relative 'projects'
|
|
5
5
|
require_relative 'workspaces'
|
|
6
6
|
require_relative 'clients'
|
|
7
|
+
require_relative 'my_tasks'
|
|
7
8
|
|
|
8
9
|
module Checkoff
|
|
9
10
|
# Query different sections of Asana projects
|
|
@@ -14,7 +15,7 @@ module Checkoff
|
|
|
14
15
|
|
|
15
16
|
extend Forwardable
|
|
16
17
|
|
|
17
|
-
attr_reader :projects, :workspaces, :time
|
|
18
|
+
attr_reader :projects, :workspaces, :time, :my_tasks
|
|
18
19
|
|
|
19
20
|
def initialize(config: Checkoff::ConfigLoader.load(:asana),
|
|
20
21
|
projects: Checkoff::Projects.new(config: config),
|
|
@@ -24,8 +25,9 @@ module Checkoff
|
|
|
24
25
|
time: Time)
|
|
25
26
|
@projects = projects
|
|
26
27
|
@workspaces = workspaces
|
|
27
|
-
@
|
|
28
|
+
@my_tasks = Checkoff::MyTasks.new(config: config, projects: projects)
|
|
28
29
|
@client = client
|
|
30
|
+
@time = time
|
|
29
31
|
end
|
|
30
32
|
|
|
31
33
|
# Returns a list of Asana API section objects for a given project
|
|
@@ -38,9 +40,12 @@ module Checkoff
|
|
|
38
40
|
# tasks with section name -> task list of the uncompleted tasks
|
|
39
41
|
def tasks_by_section(workspace_name, project_name)
|
|
40
42
|
project = project_or_raise(workspace_name, project_name)
|
|
41
|
-
|
|
43
|
+
if project_name == :my_tasks
|
|
44
|
+
my_tasks.tasks_by_section_for_my_tasks(project)
|
|
45
|
+
else
|
|
46
|
+
tasks_by_section_for_project(project)
|
|
47
|
+
end
|
|
42
48
|
end
|
|
43
|
-
cache_method :tasks_by_section, SHORT_CACHE_TIME
|
|
44
49
|
|
|
45
50
|
# XXX: Rename to section_tasks
|
|
46
51
|
#
|
|
@@ -83,7 +88,9 @@ module Checkoff
|
|
|
83
88
|
# Given a project object, pull all tasks, then provide a Hash of
|
|
84
89
|
# tasks with section name -> task list of the uncompleted tasks
|
|
85
90
|
def tasks_by_section_for_project(project)
|
|
91
|
+
# print("project: #{project}")
|
|
86
92
|
raw_tasks = projects.tasks_from_project(project)
|
|
93
|
+
# print("raw_tasks[0]: #{raw_tasks[0]}")
|
|
87
94
|
active_tasks = projects.active_tasks(raw_tasks)
|
|
88
95
|
by_section(active_tasks, project.gid)
|
|
89
96
|
end
|
data/lib/checkoff/version.rb
CHANGED
data/requirements_dev.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
pip==21.
|
|
1
|
+
pip==21.1
|
|
2
2
|
yamllint==1.26.0
|
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.16.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:
|
|
11
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -273,6 +273,7 @@ files:
|
|
|
273
273
|
- ".circleci/config.yml"
|
|
274
274
|
- ".envrc"
|
|
275
275
|
- ".git-hooks/pre_commit/circle_ci.rb"
|
|
276
|
+
- ".gitattributes"
|
|
276
277
|
- ".gitignore"
|
|
277
278
|
- ".overcommit.yml"
|
|
278
279
|
- ".rubocop.yml"
|
|
@@ -303,6 +304,7 @@ files:
|
|
|
303
304
|
- lib/checkoff/config_loader.rb
|
|
304
305
|
- lib/checkoff/create-entity.sh
|
|
305
306
|
- lib/checkoff/custom_fields.rb
|
|
307
|
+
- lib/checkoff/my_tasks.rb
|
|
306
308
|
- lib/checkoff/projects.rb
|
|
307
309
|
- lib/checkoff/sections.rb
|
|
308
310
|
- lib/checkoff/subtasks.rb
|