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 +4 -4
- data/lib/truenorth/cli.rb +21 -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: 57abc3b91e041a33f83dbc714aff68f51ae7795270be5db20d9992b5bac2a5c9
|
|
4
|
+
data.tar.gz: 65f295ddb4eb6be039778b58578abd741f0c1a242d5ba8265a729607476a187a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
data/lib/truenorth/version.rb
CHANGED
data/truenorth.gemspec
CHANGED