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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10745cdefe9b6de234e68aa53135e5bba7d89c41
4
- data.tar.gz: 5c517479b5e736ac8c6d0f687be46e62fd2e89a9
3
+ metadata.gz: b42bb5db4825c866d6763a62b4972545d35bd8d5
4
+ data.tar.gz: 4f0362689830ecb0c788f38215ee8e10fa1de6b8
5
5
  SHA512:
6
- metadata.gz: 9d698a5e0379d6b26d5ab8f726db3d227b24e11bb1eaeecf8fcf75ca99507b104cd719219782e4f46a8bc858926f77e4bc90ef5e6047f95ffd4c3f846b65b12c
7
- data.tar.gz: ad7846f329c892c5f834e88ed27f258d2ecc0277fbb22d8fc2184c0a12fd3c587bb794fa80d85445cce46168dd905efcbea3a5831bfcda91b2c4338f258f2676
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.
@@ -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 = beers.sort_by(&:name).map do |beer|
21
+ rows = sorted.map do |beer|
20
22
  [beer.name, "$%0.2f/L" % beer.price, "%0.1f%" % beer.abv]
21
23
  end
22
24
 
@@ -1,3 +1,3 @@
1
1
  module PunkyBrewster
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punky_brewster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Nicholls