fewald-worklog 0.1.20 → 0.1.22

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: b5f2675380f99341c81e753255959cc6d20bbf2ebd32f1f9c4f00134487f212e
4
- data.tar.gz: 34e6e9dd7ec2937ad479b9fa3a60a7602d7d4f8a16311bda9a451a1c082e0975
3
+ metadata.gz: a31cb533035589471189f5e67f0ca1e8f63de8a4e564dfcb84ae5d74756db93c
4
+ data.tar.gz: 34058cb4312d83e4009ce81960abd137aadf7e66942d4765e51d956607971c5a
5
5
  SHA512:
6
- metadata.gz: 1a1faec55b8533e854f5f0a6069542d3a0af385a933e8540055722723882428df8eb34ac162a9dbc3d0b4f075acfc32642a3d2cf75847441293fec5538a06950
7
- data.tar.gz: f7fd71d5d18d59643ea45bc910105a9aca1e55c3be69629aa6037a012ee216d63dfe4cd96b4d6c27ea898a0025746f3ab888b80411a17dd92e9805721cb0e38d
6
+ metadata.gz: bc5d67c3bb8b1fcd654a8836ef3486d2ee81977972285b8ab017c8f06e8822546461bc5fec68d210ba48cb276bd6d534d2727c405c29195c2fcb700e34f16d95
7
+ data.tar.gz: ba2c042ae73ebfdb7847e245a6a11cd8ec31115053a293e1f5a577e8956eb32d51ea8425ee312e49133ae6486fee46bf26d9ab4513e69a0cf98088ca9ad11395
data/.version CHANGED
@@ -1 +1 @@
1
- 0.1.20
1
+ 0.1.22
data/worklog/person.rb CHANGED
@@ -13,6 +13,8 @@ class Person
13
13
  end
14
14
 
15
15
  def to_s
16
+ return "#{name} (~#{handle})" if @email.nil?
17
+
16
18
  "#{name} (~#{handle}) <#{email}>"
17
19
  end
18
20
 
data/worklog/worklog.rb CHANGED
@@ -91,19 +91,11 @@ class Worklog
91
91
  all_logs = @storage.all_days
92
92
 
93
93
  if person
94
- person = person.strip
95
94
  unless people_map.key?(person)
96
95
  WorkLogger.error Rainbow("No person found with handle #{person}.").red
97
96
  return
98
97
  end
99
-
100
- printer = Printer.new(all_people)
101
- puts "All interactions with #{Rainbow(person).gold}:"
102
- all_logs.each do |daily_log|
103
- daily_log.entries.each do |entry|
104
- printer.print_entry(daily_log, entry, true) if entry.people.include?(person)
105
- end
106
- end
98
+ person_detail(all_logs, all_people, people_map[person.strip])
107
99
  else
108
100
  puts 'People mentioned in the work log:'
109
101
 
@@ -113,6 +105,9 @@ class Worklog
113
105
  mentions.merge!(people) { |_key, oldval, newval| oldval + newval }
114
106
  end
115
107
 
108
+ # Sort the mentions by handle
109
+ mentions = mentions.to_a.sort_by { |handle, _| handle }
110
+
116
111
  mentions.each do |handle, v|
117
112
  if people_map.key?(handle)
118
113
  print "#{Rainbow(people_map[handle].name).gold} (#{handle})"
@@ -124,6 +119,25 @@ class Worklog
124
119
  end
125
120
  end
126
121
 
122
+ def person_detail(all_logs, all_people, person)
123
+ printer = Printer.new(all_people)
124
+ puts "All interactions with #{Rainbow(person.name).gold}"
125
+
126
+ if person.notes
127
+ puts 'Notes:'
128
+ person.notes.each do |note|
129
+ puts "* #{note}"
130
+ end
131
+ end
132
+
133
+ puts 'Interactions:'
134
+ all_logs.each do |daily_log|
135
+ daily_log.entries.each do |entry|
136
+ printer.print_entry(daily_log, entry, true) if entry.people.include?(person.handle)
137
+ end
138
+ end
139
+ end
140
+
127
141
  def tags(_options = {})
128
142
  all_logs = @storage.all_days
129
143
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fewald-worklog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Friedrich Ewald
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-25 00:00:00.000000000 Z
10
+ date: 2025-05-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: httparty