README.md in punky_brewster-1.2.0 vs README.md in punky_brewster-1.3.0
- old
+ new
@@ -6,31 +6,38 @@
gem install punky_brewster
## Command line tool
+List beers:
+
$ punky_brewster
8 WIRED HOPWIRED $16.00/L 7.3%
ALL CHIEFS , NO INDIANS $14.00/L 6.0%
CROUCHER LOW RIDER IPA $12.00/L 2.7%
DALES ESB (EXTRA SPECIAL BITTER) $14.00/L 5.6%
...
+Sort beers (can be sorted by `price`, `abv`, or `abv_per_dollar`):
+
$ punky_brewster --sort price
CROUCHER LOW RIDER IPA $12.00/L 2.7%
TUATARA ITI AMERICAN PALE ALE $12.50/L 5.8%
MUSSEL INN CAPTAIN COOKER $12.50/L 5.7%
VALKYRIE FRIGG RED PILSENER $13.50/L 5.0%
+ ...
+List beers sorted by most ABV per dollar:
- $ punky_brewster --sort abv
- CROUCHER LOW RIDER IPA $12.00/L 2.7%
- RENAISSANCE PARADOX PILSENER $14.00/L 4.0%
- GARAGE PROJECT HAPI DAZE $14.00/L 4.2%
- GOLDEN ALE FRESH HOP $16.00/L 4.5%
- INVERCARGILL PITCHBLACK STOUT $13.50/L 4.5%
+ $ punky_brewster --holla-for-dollar
+ MIKE'S VANILLA COFFEE PORTER $16.00/L 8.0% 0.50%/$
+ RAINDOGS OXYMORON BLACK IPA $14.50/L 7.0% 0.48%/$
+ GOLDEN EAGLE BIG YANK $16.00/L 7.5% 0.47%/$
+ MUSSEL INN CAPTAIN COOKER $12.50/L 5.7% 0.46%/$
+ ...
+
## Ruby Library
```ruby
require 'punky_brewster'
BeerListRequest.new.beers
@@ -43,22 +50,10 @@
```ruby
require 'punky_brewster/server'
run PunkyBrewster::Server
```
-```http
-$ curl -i localhost:9292
-
-HTTP/1.1 200 OK
-Content-Type: application/json
-Transfer-Encoding: chunked
-Connection: close
-Server: thin
-
-[{"name":"EPIC PALE ALE","price":14.0,"abv":5.4},{"name":"8 WIRED HOPWIRED","price":16.0,"abv":7.3},{"name":"MUSSEL INN CAPTAIN COOKER","price":12.5,"abv":5.7},{"name":"FUNK ESTATE NZPA FRESH HOP","price":16.0,"abv":5.5},{"name":"INVERCARGILL PITCHBLACK STOUT","price":13.5,"abv":4.5},{"name":"GOLDEN EAGLE BIG YANK","price":16.0,"abv":7.5},{"name":"RENAISSANCE PARADOX PILSENER","price":14.0,"abv":4.0}]
-```
-
Mount alongside other Rack apps (Rails, Sinatra, etc.):
```ruby
require 'punky_brewster/server'
run Rack::URLMap.new("/punky_brewster/beers.json" => PunkyBrewster::Server)
@@ -69,9 +64,23 @@
```ruby
require 'rack/contrib/json'
require 'punky_brewster/server'
use Rack::JSONP
run PunkyBrewster::Server
+```
+
+Response:
+
+```json
+[
+ {
+ "name": "EPIC PALE ALE",
+ "price": 14.0,
+ "abv": 5.4,
+ "image_url": "http://www.punkybrewster.co.nz/uploads/..."
+ },
+ ...
+]
```
## Development
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.