abt-cli 0.0.31 → 0.0.32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b0f6705f90f844f11a301d2aee417ded8524de882bba8cd114d62ceee77ee92
4
- data.tar.gz: d51120f9529853801fefd8b557102e1cac058685da5208f5a42577726e3c871d
3
+ metadata.gz: 38d3fa16692941ffa0e720a7a0331d91215e33e37092946df35053f040ee2af8
4
+ data.tar.gz: b2471d250f4580b9334f7005496e45ae1487eb8e979bcf3aedd975e3f418c79b
5
5
  SHA512:
6
- metadata.gz: f2e08dd8e61a8d0271661af7e653b4da5d26f5ba0790cf657e2ec0c8524d784af707e1cd9bb2914192ba6943ae1d39f845aedd80c3dbffc2f529a46b9a0dba5d
7
- data.tar.gz: 728e3b2cfbe503ab9188b789510c112e3f2c569e32a3a541f1f30e454bfdd80381f0a35185fc0b10ad9ff9751141dc168bdb84422b09657b46621f04df982df1
6
+ metadata.gz: c5232fcb04eb5c3c35cae6b29a82586ef289316a3540eec50f63aa55b42a79226e4000d3c6cff37a318cf8b93d17f47df3cccd8a61f68d02e2fccbe0f9aacd18
7
+ data.tar.gz: 59cc3c70175c71420cbb2c0bc0b6e96d40b34c21a225cf4f2e3e310fa33f228a1792a31d6eeb9b4485ef140f75f88358679e08d301ef7adde736b5f45fe86ddf
@@ -15,7 +15,7 @@ module Abt
15
15
  end
16
16
 
17
17
  def path
18
- Path.new(local_available? && git["path"] || directory_config["path"] || "")
18
+ Path.new((local_available? && git["path"]) || directory_config["path"] || "")
19
19
  end
20
20
 
21
21
  def path=(new_path)
@@ -45,7 +45,7 @@ module Abt
45
45
  cli.warn("Section is empty")
46
46
  select_task
47
47
  else
48
- cli.prompt.choice("Select a task", tasks, nil_option: true) || select_task
48
+ cli.prompt.choice("Select a task", options_for_tasks(tasks), nil_option: true) || select_task
49
49
  end
50
50
  end
51
51
 
@@ -53,12 +53,32 @@ module Abt
53
53
  cli.prompt.choice("Which section in #{project['name']}?", sections)
54
54
  end
55
55
 
56
+ def options_for_tasks(tasks)
57
+ tasks.map do |task|
58
+ formatted_name = [
59
+ task["name"],
60
+ formatted_assignee(task)
61
+ ].compact.join(" ")
62
+
63
+ task.merge("name" => formatted_name)
64
+ end
65
+ end
66
+
67
+ def formatted_assignee(task)
68
+ name = task.dig("assignee", "name")
69
+
70
+ return unless name
71
+
72
+ initials = name.split.map(&:chr).join.upcase
73
+ "(#{initials}👤)"
74
+ end
75
+
56
76
  def tasks_in_section(section)
57
77
  cli.warn("Fetching tasks...")
58
78
  tasks = api.get_paged(
59
79
  "tasks",
60
80
  section: section["gid"],
61
- opt_fields: "name,completed,permalink_url"
81
+ opt_fields: "name,completed,permalink_url,assignee.name"
62
82
  )
63
83
 
64
84
  # The below filtering is the best we can do with Asanas api, see this:
@@ -15,7 +15,7 @@ module Abt
15
15
  end
16
16
 
17
17
  def path
18
- Path.new(local_available? && git["path"] || cli.directory_config.dig("devops", "path") || "")
18
+ Path.new((local_available? && git["path"]) || cli.directory_config.dig("devops", "path") || "")
19
19
  end
20
20
 
21
21
  def path=(new_path)
@@ -15,7 +15,7 @@ module Abt
15
15
  end
16
16
 
17
17
  def path
18
- Path.new(local_available? && git["path"] || cli.directory_config.dig("harvest", "path") || "")
18
+ Path.new((local_available? && git["path"]) || cli.directory_config.dig("harvest", "path") || "")
19
19
  end
20
20
 
21
21
  def path=(new_path)
@@ -15,8 +15,8 @@ module Abt
15
15
  raise Abt::Cli::Abort, "Invalid time: #{hh_mm_ss}, supported formats are: HH:MM, HH:MM:SS" if match.nil?
16
16
 
17
17
  match[:hours].to_i +
18
- match[:minutes].to_i / 60.0 +
19
- match[:seconds].to_i / 60.0 / 60.0
18
+ (match[:minutes].to_i / 60.0) +
19
+ (match[:seconds].to_i / 60.0 / 60.0)
20
20
  end
21
21
  end
22
22
  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.31"
4
+ VERSION = "0.0.32"
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.31
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesper Sørensen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-04 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-inflector
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.0'
69
- description:
69
+ description:
70
70
  email:
71
71
  - js@abtion.com
72
72
  executables:
@@ -159,7 +159,8 @@ licenses:
159
159
  metadata:
160
160
  homepage_uri: https://github.com/abtion/abt
161
161
  source_code_uri: https://github.com/abtion/abt
162
- post_install_message:
162
+ rubygems_mfa_required: 'true'
163
+ post_install_message:
163
164
  rdoc_options: []
164
165
  require_paths:
165
166
  - lib
@@ -174,8 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
175
  - !ruby/object:Gem::Version
175
176
  version: '0'
176
177
  requirements: []
177
- rubygems_version: 3.1.4
178
- signing_key:
178
+ rubygems_version: 3.2.15
179
+ signing_key:
179
180
  specification_version: 4
180
181
  summary: Versatile scripts
181
182
  test_files: []