truenorth 0.2.0 → 0.2.1
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/lib/truenorth/cli.rb +24 -12
- data/lib/truenorth/client.rb +1 -1
- data/lib/truenorth/version.rb +1 -1
- data/truenorth.gemspec +1 -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: e87118951efd2a17d5a397ed0a2310375c801726f47a8b223048451eb52ebb66
|
|
4
|
+
data.tar.gz: 711e12dcee70510754c658ac5abb86f856be2d2ca30f774a40a877000c7f867d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ba46733ebd70eb267bf59dd7b4622eef5278af57dd55b8a26233f3b90c8a236a2d766555908d564ab304690e1a39a0278ffe4c731a97e7cac33389ba6ff826f
|
|
7
|
+
data.tar.gz: 795052f4e320adf8042158fbfc7f3c74c7456e3230914a6a67e133485d99fb53d0748ee9bd82b7f6972e69c5dad0912c2d19044f3ebec53b62af583a325a3ccd
|
data/lib/truenorth/cli.rb
CHANGED
|
@@ -193,17 +193,33 @@ module Truenorth
|
|
|
193
193
|
term_width = begin
|
|
194
194
|
IO.console.winsize[1]
|
|
195
195
|
rescue StandardError
|
|
196
|
-
|
|
196
|
+
120
|
|
197
197
|
end
|
|
198
198
|
|
|
199
|
+
# Fixed column widths
|
|
200
|
+
col_idx = 4 # Index column
|
|
201
|
+
col_date = 6 # Date column (MM-DD)
|
|
202
|
+
col_time = 16 # Time column (HH:MM (XXXmin))
|
|
203
|
+
col_member = 17 # Member column
|
|
204
|
+
fixed_width = col_idx + col_date + col_time + col_member + 10 # +10 for padding/borders
|
|
205
|
+
|
|
206
|
+
# Activity column gets remaining space
|
|
207
|
+
col_activity = [term_width - fixed_width, 20].max
|
|
208
|
+
|
|
199
209
|
# Prepare table data
|
|
200
210
|
rows = results.each_with_index.map do |res, idx|
|
|
211
|
+
member_display = if res[:member].nil?
|
|
212
|
+
'● You'
|
|
213
|
+
else
|
|
214
|
+
" #{truncate_text(res[:member], col_member - 2)}"
|
|
215
|
+
end
|
|
216
|
+
|
|
201
217
|
[
|
|
202
218
|
(idx + 1).to_s,
|
|
203
219
|
format_compact_date(res[:date]),
|
|
204
220
|
format_compact_time(res[:time]),
|
|
205
|
-
truncate_text(res[:activity] || '',
|
|
206
|
-
|
|
221
|
+
truncate_text(res[:activity] || '', col_activity),
|
|
222
|
+
member_display
|
|
207
223
|
]
|
|
208
224
|
end
|
|
209
225
|
|
|
@@ -213,18 +229,14 @@ module Truenorth
|
|
|
213
229
|
rows: rows
|
|
214
230
|
)
|
|
215
231
|
|
|
216
|
-
# Render with
|
|
217
|
-
renderer =
|
|
218
|
-
|
|
219
|
-
else
|
|
220
|
-
:unicode
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
puts table.render(renderer, padding: [0, 1])
|
|
232
|
+
# Render with unicode for full width
|
|
233
|
+
renderer = :unicode
|
|
234
|
+
puts table.render(renderer, padding: [0, 1], width: term_width)
|
|
224
235
|
end
|
|
225
236
|
|
|
226
237
|
def format_reservation_line(res)
|
|
227
|
-
|
|
238
|
+
member = res[:member] || 'You'
|
|
239
|
+
"#{format_compact_date(res[:date])} #{format_compact_time(res[:time])} - #{res[:activity]} - #{member}"
|
|
228
240
|
end
|
|
229
241
|
|
|
230
242
|
def format_compact_date(date_str)
|
data/lib/truenorth/client.rb
CHANGED
|
@@ -225,7 +225,7 @@ module Truenorth
|
|
|
225
225
|
member_name = if member_match
|
|
226
226
|
member_match[1].strip
|
|
227
227
|
elsif header_text.start_with?('My Reservations')
|
|
228
|
-
'
|
|
228
|
+
nil # nil means it's the logged-in user
|
|
229
229
|
end
|
|
230
230
|
|
|
231
231
|
# Now find all tables within this member section
|
data/lib/truenorth/version.rb
CHANGED
data/truenorth.gemspec
CHANGED