pot_of_coffee 0.1.3 → 0.1.4
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/bin/pot_of_coffee +35 -8
- data/lib/pot_of_coffee/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dae6851d3f6b176c848021118ba99f6f0a6a341
|
4
|
+
data.tar.gz: 7da04121b0e181498651568d567938ea43bc054a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccf5fe51ce999c03091ea604c5760f4ee0a083e1fcde1d2ca8e1fca428c37723267baab63e494394b110e5b648b4f2d98d452351e52cc850c98363ddc8c79c64
|
7
|
+
data.tar.gz: ee37badbcdabaaa07f3b1e96a67e9c8f4281e786f5a6e878ebea3f44bb74e77c160fdad0eeeda652a69d7dffd40489d1ecc7f3b10d420d66ff53315835b7150d
|
data/bin/pot_of_coffee
CHANGED
@@ -1,15 +1,42 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'optparse'
|
3
4
|
require 'pot_of_coffee'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
options = {
|
7
|
+
quantity: 12,
|
8
|
+
strength: :normal,
|
9
|
+
units: PotOfCoffee::ImperialUnit.new
|
10
|
+
}
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
units = PotOfCoffee::MetricUnit.new
|
12
|
+
OptionParser.new do |opts|
|
13
|
+
opts.banner = "Usage: #{File.basename(__FILE__)} [options]"
|
13
14
|
|
14
|
-
|
15
|
+
opts.on('-q', '--quantity [QUANTITY]', Integer, "Number of cups of coffee you'd like") do |v|
|
16
|
+
options[:quantity] = v
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on('-s', '--strength [STRENGTH]', String, 'Strength of your coffee (normal, strong, weak)') do |v|
|
20
|
+
options[:strength] = v.to_sym
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on('-u', '--units [UNITS]', 'Units for your coffee brew (imperial, metric)') do |v|
|
24
|
+
options[:units] = case v
|
25
|
+
when 'metric'
|
26
|
+
PotOfCoffee::MetricUnit.new
|
27
|
+
when 'imperial'
|
28
|
+
PotOfCoffee::ImperialUnit.new
|
29
|
+
else
|
30
|
+
puts "#{v} is not 'imperial' or 'metric'"
|
31
|
+
exit
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
opts.on( '-h', '--help', 'Display this screen' ) do
|
36
|
+
puts opts
|
37
|
+
exit
|
38
|
+
end
|
39
|
+
end.parse!
|
40
|
+
|
41
|
+
pot_of_coffee = PotOfCoffee::Brewer.new(options)
|
15
42
|
puts pot_of_coffee.instructions
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pot_of_coffee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Shaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|