random_pizza 0.1.4 → 0.1.6
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/{pizza → random_pizza} +1 -1
- data/lib/random_pizza.rb +19 -10
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb7b06965747b82e4b9075edece97047f7322422
|
|
4
|
+
data.tar.gz: 0780ad93541a97ea23112a425ec7a81729476097
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb33d3c1ed3fc7e54ca1e98af22bd6f8fa3778582a79dacca6e66f83d6c417b4e958172fd3ec0a1d55a9868e023f8eca31b65fa15c1afeb04b3d87cd01f57a45
|
|
7
|
+
data.tar.gz: 80986e59de20605ca06753a173bcb60c52c55297d884cbb479a9d61b131fb269ee6ebae0b09692c149c1e85d69aac1e2dea10ff733f8a44c07c5e25b0c50c26c
|
data/bin/{pizza → random_pizza}
RENAMED
data/lib/random_pizza.rb
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This class suggests a random pizza to adventurous impatient hungry people
|
|
3
|
+
|
|
1
4
|
class RandomPizza
|
|
2
|
-
attr_accessor :suggestion
|
|
3
5
|
|
|
4
|
-
def initialize
|
|
5
|
-
#puts s
|
|
6
|
-
end
|
|
7
|
-
|
|
8
6
|
def suggestion
|
|
9
|
-
"You should try #{crust} crust with #{sauce} and #{toppings}."
|
|
7
|
+
"You should try #{crust} crust with #{sauce} sauce and #{toppings}."
|
|
10
8
|
end
|
|
11
9
|
|
|
10
|
+
private
|
|
11
|
+
|
|
12
12
|
def crust
|
|
13
13
|
["whole wheat", "thin", "gluten-free", "classic"].sample
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def sauce
|
|
17
|
-
["tomato
|
|
17
|
+
["tomato", "garlic and olive oil", "pesto", "vegan bechamel"].sample
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def toppings n=3
|
|
21
|
+
toppings = ["garlic", "onions", "tomatoes", "olives", "green peppers", "potatoes", "spinach",
|
|
22
|
+
"artichoke hearts", "roasted red peppers", "jalapenos", "pineapple", "roasted garlic",
|
|
23
|
+
"sun-dried tomatoes", "tempeh bacon", "roasted beets"]
|
|
24
|
+
return join_with_comma toppings.sample(n)
|
|
18
25
|
end
|
|
19
26
|
|
|
20
|
-
def
|
|
21
|
-
[
|
|
27
|
+
def join_with_comma(items)
|
|
28
|
+
items[-1] = "and #{items[-1]}"
|
|
29
|
+
return items.join(", ") if items.count > 2
|
|
30
|
+
return items.join(" ") if items.count <= 2
|
|
22
31
|
end
|
|
23
32
|
|
|
24
|
-
end
|
|
33
|
+
end
|
metadata
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: random_pizza
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lynne Cooney
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-03-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Generate a random pizza suggestion
|
|
14
14
|
email: ilynne@gmail.com
|
|
15
15
|
executables:
|
|
16
|
-
-
|
|
16
|
+
- random_pizza
|
|
17
17
|
extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
20
|
- lib/random_pizza.rb
|
|
21
|
-
- bin/
|
|
21
|
+
- bin/random_pizza
|
|
22
22
|
homepage: http://rubygems.org/gems/random_pizza
|
|
23
23
|
licenses:
|
|
24
24
|
- MIT
|