punky_brewster 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/punky_brewster/cli.rb +3 -1
- data/lib/punky_brewster/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b42bb5db4825c866d6763a62b4972545d35bd8d5
|
4
|
+
data.tar.gz: 4f0362689830ecb0c788f38215ee8e10fa1de6b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cb0a32a2e36c61342dc4aef0b72381df878abcad434ecf6b90951b08c56d19dc2a4977ca0fa060e322a1f4ebcf26228286318030b7653a4de49972f05e1a665
|
7
|
+
data.tar.gz: b5439ce0a32fe67f65198cc670f074659e90a0cf504dd1b5e10d63183d965c9f99ca3ae4a37b962c8c5ce46d16e1a3ed6815fec5039caaafdf4d7fa2690285c1
|
data/README.md
CHANGED
@@ -15,6 +15,20 @@ What's on tap?
|
|
15
15
|
DALES ESB (EXTRA SPECIAL BITTER) $14.00/L 5.6%
|
16
16
|
...
|
17
17
|
|
18
|
+
$ punky_brewster --sort price
|
19
|
+
CROUCHER LOW RIDER IPA $12.00/L 2.7%
|
20
|
+
TUATARA ITI AMERICAN PALE ALE $12.50/L 5.8%
|
21
|
+
MUSSEL INN CAPTAIN COOKER $12.50/L 5.7%
|
22
|
+
VALKYRIE FRIGG RED PILSENER $13.50/L 5.0%
|
23
|
+
|
24
|
+
|
25
|
+
$ punky_brewster --sort abv
|
26
|
+
CROUCHER LOW RIDER IPA $12.00/L 2.7%
|
27
|
+
RENAISSANCE PARADOX PILSENER $14.00/L 4.0%
|
28
|
+
GARAGE PROJECT HAPI DAZE $14.00/L 4.2%
|
29
|
+
GOLDEN ALE FRESH HOP $16.00/L 4.5%
|
30
|
+
INVERCARGILL PITCHBLACK STOUT $13.50/L 4.5%
|
31
|
+
|
18
32
|
## Development
|
19
33
|
|
20
34
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/punky_brewster/cli.rb
CHANGED
@@ -13,10 +13,12 @@ module PunkyBrewster
|
|
13
13
|
end
|
14
14
|
|
15
15
|
desc "list", "Show current beer list"
|
16
|
+
method_option :sort, default: "name", enum: %w( name price abv )
|
16
17
|
def list
|
17
18
|
beers = BeerListRequest.new.beers
|
19
|
+
sorted = beers.sort_by { |beer| beer.send(options[:sort]) }
|
18
20
|
|
19
|
-
rows =
|
21
|
+
rows = sorted.map do |beer|
|
20
22
|
[beer.name, "$%0.2f/L" % beer.price, "%0.1f%" % beer.abv]
|
21
23
|
end
|
22
24
|
|