abt-cli 0.0.19 → 0.0.20

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: 295db35510e60a5b46ea7f20caa01aaad247bb30cb60e61b912cab5f754637ac
4
- data.tar.gz: e686eb40fc1ac88315c138eac56b96500c29c3f012b4bdb1d97f993a507f80b7
3
+ metadata.gz: 6348f086170cb21625ec22595423cebbca76b0455f6dc2ad552ef072019b3929
4
+ data.tar.gz: e53c442f505ba9141e62d2b4c7883ec010c966b4d1deef0d71651b94ea11db93
5
5
  SHA512:
6
- metadata.gz: f18aa2b4f33bb6b51689522bca357ddb0fbe7a2d2e968bcc6754959f01bf6d54b9f93c387e8a050d165063cad26e6b360f245d2e7fa317bc1fbad8c0fa0d3379
7
- data.tar.gz: ab46d17a29d4e447472c8c4d9242aa2e96bd5195bad4083d0476054f312d358ad5555526b44edacdf2512713e646435200689f82e8a097c1dfa306ff2ae1c4df
6
+ metadata.gz: 977ff0fbc908433afdf996cdd354bd33ea9a315cfebcbc456f42df731309f0502801516995f0ded85a58f8efcfeb0fe9830dd31c51efcb05f4acb58ddb3e3833
7
+ data.tar.gz: 45d25bbae2c077af24c304132703ca8ebc7a0968c04aafc598ca48a66cd3f303fe5cc108e193e24bd8f5cbb09e37d831eeba3518c360bafb1112f4ae443138cd
@@ -14,7 +14,7 @@ module Abt
14
14
  end
15
15
 
16
16
  def perform
17
- unless config.local_available?
17
+ unless project_gid == config.path.project_gid
18
18
  abort 'This is a no-op for tasks outside the current project'
19
19
  end
20
20
  require_task!
@@ -57,11 +57,7 @@ module Abt
57
57
 
58
58
  def task
59
59
  @task ||= begin
60
- if task_gid.nil?
61
- nil
62
- else
63
- api.get("tasks/#{task_gid}", opt_fields: 'name,memberships.section.name,permalink_url')
64
- end
60
+ api.get("tasks/#{task_gid}", opt_fields: 'name,memberships.section.name,permalink_url')
65
61
  end
66
62
  end
67
63
  end
@@ -65,7 +65,7 @@ module Abt
65
65
 
66
66
  # The below filtering is the best we can do with Asanas api, see this:
67
67
  # https://forum.asana.com/t/tasks-query-completed-since-is-broken-for-sections/21461
68
- tasks.filter { |task| !task['completed'] }
68
+ tasks.select { |task| !task['completed'] }
69
69
  end
70
70
 
71
71
  def sections
@@ -33,7 +33,7 @@ module Abt
33
33
  @tasks ||= begin
34
34
  warn 'Fetching tasks...'
35
35
  tasks = api.get_paged('tasks', project: project['gid'], opt_fields: 'name,completed')
36
- tasks.filter { |task| !task['completed'] }
36
+ tasks.select { |task| !task['completed'] }
37
37
  end
38
38
  end
39
39
  end
@@ -88,18 +88,18 @@ module Abt
88
88
 
89
89
  def prompt_section(message)
90
90
  cli.warn 'Fetching sections...'
91
- sections = api.get_paged("projects/#{path.project_gid}/sections")
91
+ sections = api.get_paged("projects/#{path.project_gid}/sections", opt_fields: 'name')
92
92
  cli.prompt.choice(message, sections)
93
93
  end
94
94
 
95
95
  def prompt_workspace
96
96
  cli.warn 'Fetching workspaces...'
97
- workspaces = api.get_paged('workspaces')
97
+ workspaces = api.get_paged('workspaces', opt_fields: 'name')
98
98
  if workspaces.empty?
99
99
  cli.abort 'Your asana access token does not have access to any workspaces'
100
100
  elsif workspaces.one?
101
101
  workspace = workspaces.first
102
- cli.warn "Selected Asana workspace #{workspace['name']}"
102
+ cli.warn "Selected Asana workspace: #{workspace['name']}"
103
103
  else
104
104
  workspace = cli.prompt.choice('Select Asana workspace', workspaces)
105
105
  end
data/lib/abt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Abt
4
- VERSION = '0.0.19'
4
+ VERSION = '0.0.20'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abt-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesper Sørensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-inflector