truenorth 0.2.1 → 0.2.3

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: e87118951efd2a17d5a397ed0a2310375c801726f47a8b223048451eb52ebb66
4
- data.tar.gz: 711e12dcee70510754c658ac5abb86f856be2d2ca30f774a40a877000c7f867d
3
+ metadata.gz: a5f3438794269dffcf86a880d84a026215705c4f209224788e6ea23455b14ea1
4
+ data.tar.gz: 01de8411d76be106e62a870885011c27cd10ec2df715af9300be9c1c6c545b75
5
5
  SHA512:
6
- metadata.gz: 5ba46733ebd70eb267bf59dd7b4622eef5278af57dd55b8a26233f3b90c8a236a2d766555908d564ab304690e1a39a0278ffe4c731a97e7cac33389ba6ff826f
7
- data.tar.gz: 795052f4e320adf8042158fbfc7f3c74c7456e3230914a6a67e133485d99fb53d0748ee9bd82b7f6972e69c5dad0912c2d19044f3ebec53b62af583a325a3ccd
6
+ metadata.gz: 5a9f8bb510b0d8e697dba433e05ff634dbb433a449afffbfef66eebb1cd0c371bc8533d3e858f397642ee5e722987d71693395a2b2133ef21f4281f93e5c3820
7
+ data.tar.gz: d383619f1d8df6b96f1628a7e6b642a6739b1f3ba7c74c4d0d8fa8b944a8b2f92f75e73d9be482a84654f8b15ec8de22d05153b7f7c29d3adbbc4949b415bd7f
data/lib/truenorth/cli.rb CHANGED
@@ -97,6 +97,7 @@ module Truenorth
97
97
 
98
98
  desc 'reservations', 'List your current reservations'
99
99
  option :json, type: :boolean, desc: 'Output as JSON'
100
+ option :all, type: :boolean, aliases: '-a', desc: 'Show all family members (default: only you)'
100
101
  def reservations
101
102
  client = Client.new
102
103
 
@@ -109,7 +110,26 @@ module Truenorth
109
110
  if results.empty?
110
111
  say 'No reservations found.', :yellow
111
112
  else
112
- display_reservations_table(results)
113
+ # Filter to only "You" unless --all is specified
114
+ your_reservations = results.select { |r| r[:member].nil? }
115
+ other_count = results.length - your_reservations.length
116
+
117
+ if options[:all]
118
+ display_reservations_table(results)
119
+ else
120
+ if your_reservations.empty?
121
+ say 'You have no reservations.', :yellow
122
+ if other_count > 0
123
+ say "Note: #{other_count} reservation#{'s' if other_count != 1} for other family members", :cyan
124
+ say "Use 'truenorth reservations --all' to see all", :cyan
125
+ end
126
+ else
127
+ display_reservations_table(your_reservations)
128
+ if other_count > 0
129
+ say "\nNote: #{other_count} reservation#{'s' if other_count != 1} for other family members (use --all to show)", :cyan
130
+ end
131
+ end
132
+ end
113
133
  end
114
134
  end
115
135
  rescue Error => e
@@ -200,11 +220,12 @@ module Truenorth
200
220
  col_idx = 4 # Index column
201
221
  col_date = 6 # Date column (MM-DD)
202
222
  col_time = 16 # Time column (HH:MM (XXXmin))
223
+ col_court = 18 # Court/Location column
203
224
  col_member = 17 # Member column
204
- fixed_width = col_idx + col_date + col_time + col_member + 10 # +10 for padding/borders
225
+ fixed_width = col_idx + col_date + col_time + col_court + col_member + 12 # +12 for padding/borders
205
226
 
206
227
  # Activity column gets remaining space
207
- col_activity = [term_width - fixed_width, 20].max
228
+ col_activity = [term_width - fixed_width, 15].max
208
229
 
209
230
  # Prepare table data
210
231
  rows = results.each_with_index.map do |res, idx|
@@ -219,13 +240,14 @@ module Truenorth
219
240
  format_compact_date(res[:date]),
220
241
  format_compact_time(res[:time]),
221
242
  truncate_text(res[:activity] || '', col_activity),
243
+ truncate_text(res[:court] || '', col_court),
222
244
  member_display
223
245
  ]
224
246
  end
225
247
 
226
248
  # Create table
227
249
  table = TTY::Table.new(
228
- header: ['#', 'Date', 'Time', 'Activity', 'Member'],
250
+ header: ['#', 'Date', 'Time', 'Activity', 'Court', 'Member'],
229
251
  rows: rows
230
252
  )
231
253
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Truenorth
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.3'
5
5
  end
data/truenorth.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'truenorth'
5
- spec.version = '0.2.1'
5
+ spec.version = '0.2.3'
6
6
  spec.authors = ['usiegj00']
7
7
  spec.email = ['112138+usiegj00@users.noreply.github.com']
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: truenorth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - usiegj00