fewald-worklog 0.3.4 → 0.3.5
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/.version +1 -1
- data/lib/cli.rb +1 -0
- data/lib/person.rb +17 -1
- data/lib/worklog.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4b6b051e9dd15f4588ddcff4a3f23686077c3b6fa8c8fda053cd6187a91a34c
|
|
4
|
+
data.tar.gz: 7a3b6ff79f314e30016776efed9fbe2a76b68e46658c4658185577f27a7cf3bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23c300fa90069057589a947ff9da63db056f28bc7021ba7a9a19cfd28dbf424ed1ada21a24a76cd29b72f1810a7f7c14bdd9c4547b84e330ef96e99b1dbfd640
|
|
7
|
+
data.tar.gz: 627e537ca0e1530d64bf7b4a1c78709f9910bcec382ed8c1dba43d7a0c35bc32f1488f45490d8432d5aae0cf4db1e8692982a46416821b8afe7bf8108738f58f
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.5
|
data/lib/cli.rb
CHANGED
|
@@ -110,6 +110,7 @@ class WorklogCLI < Thor
|
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
desc 'people', 'Show all people mentioned in the work log'
|
|
113
|
+
option :inactive, type: :boolean, default: false, desc: 'Include inactive people in the list'
|
|
113
114
|
def people(person = nil)
|
|
114
115
|
worklog = Worklog::Worklog.new
|
|
115
116
|
worklog.people(person, options)
|
data/lib/person.rb
CHANGED
|
@@ -13,8 +13,10 @@ module Worklog
|
|
|
13
13
|
# @return [String, nil] The team the person belongs to, can be nil
|
|
14
14
|
# !attribute [r] notes
|
|
15
15
|
# @return [Array<String>] An array of notes about the person
|
|
16
|
+
# !attribute [r] inactive
|
|
17
|
+
# @return [Boolean] Whether the person is inactive (for example left the company)
|
|
16
18
|
class Person
|
|
17
|
-
attr_reader :handle, :github_username, :name, :email, :team, :notes
|
|
19
|
+
attr_reader :handle, :github_username, :name, :email, :team, :notes, :inactive
|
|
18
20
|
|
|
19
21
|
def initialize(handle:, name:, **params)
|
|
20
22
|
# params to symbol keys
|
|
@@ -26,6 +28,20 @@ module Worklog
|
|
|
26
28
|
@email = params[:email]
|
|
27
29
|
@team = params[:team]
|
|
28
30
|
@notes = params[:notes] || []
|
|
31
|
+
@inactive = params[:inactive] || false
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns true if the person is active (not inactive).
|
|
35
|
+
# If not specified, persons are active by default.
|
|
36
|
+
# @return [Boolean] true if active, false otherwise
|
|
37
|
+
def active?
|
|
38
|
+
!@inactive
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns true if the person is marked as inactive.
|
|
42
|
+
# @return [Boolean] true if inactive, false otherwise
|
|
43
|
+
def inactive?
|
|
44
|
+
@inactive
|
|
29
45
|
end
|
|
30
46
|
|
|
31
47
|
# Creates a new Person instance from a hash of attributes.
|
data/lib/worklog.rb
CHANGED
|
@@ -157,7 +157,7 @@ module Worklog
|
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
# Show all known people and details about a specific person.
|
|
160
|
-
def people(person = nil,
|
|
160
|
+
def people(person = nil, options = {})
|
|
161
161
|
all_logs = @storage.all_days
|
|
162
162
|
|
|
163
163
|
if person
|
|
@@ -180,6 +180,8 @@ module Worklog
|
|
|
180
180
|
|
|
181
181
|
mentions.each do |handle, v|
|
|
182
182
|
if @people.key?(handle)
|
|
183
|
+
next unless @people[handle].active? || options[:inactive]
|
|
184
|
+
|
|
183
185
|
person = @people[handle]
|
|
184
186
|
print "#{Rainbow(person.name).gold} (#{handle})"
|
|
185
187
|
print " (#{person.team})" if person.team
|
|
@@ -195,6 +197,8 @@ module Worklog
|
|
|
195
197
|
printer = Printer.new(@config, all_people)
|
|
196
198
|
puts "All interactions with #{Rainbow(person.name).gold}"
|
|
197
199
|
|
|
200
|
+
puts "GitHub: #{Rainbow(person.github_username).blue}" if person.github_username
|
|
201
|
+
|
|
198
202
|
if person.notes
|
|
199
203
|
puts 'Notes:'
|
|
200
204
|
person.notes.each do |note|
|