truenorth 0.2.1 → 0.2.2

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: 57abc3b91e041a33f83dbc714aff68f51ae7795270be5db20d9992b5bac2a5c9
4
+ data.tar.gz: 65f295ddb4eb6be039778b58578abd741f0c1a242d5ba8265a729607476a187a
5
5
  SHA512:
6
- metadata.gz: 5ba46733ebd70eb267bf59dd7b4622eef5278af57dd55b8a26233f3b90c8a236a2d766555908d564ab304690e1a39a0278ffe4c731a97e7cac33389ba6ff826f
7
- data.tar.gz: 795052f4e320adf8042158fbfc7f3c74c7456e3230914a6a67e133485d99fb53d0748ee9bd82b7f6972e69c5dad0912c2d19044f3ebec53b62af583a325a3ccd
6
+ metadata.gz: 4c1c9f59b8a041d3b54e1095596ee5359054d9c8765a33420db020e3a0d8a8af4a6bc0571d9a3135aa2b4d04db2a938767d67d72a258e2d89f0f3d1518a154d2
7
+ data.tar.gz: 1c33dfcb976fc18051f68176afddca7ef7e3a65200fead716e56643e7d81c6c0f9abab243138bcc848fff040e71ded26ebaa7d265809292317c84d9c318b7f34
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
@@ -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.2'
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.2'
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - usiegj00