top-recipes 0.1.1 → 0.1.2
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/lib/top_recipes/cli.rb +8 -15
- data/lib/top_recipes/recipe.rb +8 -0
- data/lib/top_recipes/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: 7eca309c16596908bf90382548dbdf8084b655c0
|
|
4
|
+
data.tar.gz: d6d928b41fa5bec42ee722406e987e6e54883d90
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 704004e4649d52e414eda750d79cc2e1a3e67f5066fe8ddc49617e8d02f7542ae73146a8194c5e627592cf159ef5e46de183ee021560a7e67dc3fead2cbb5cf6
|
|
7
|
+
data.tar.gz: 40ca6d49ee29f6cf6218e832b990e29d9694c14f202761563ef07a2164186fe96089a16970550de827a3a06726d707fbbe307c7664c830cf2155e81f63f9c318
|
data/lib/top_recipes/cli.rb
CHANGED
|
@@ -43,7 +43,7 @@ class TopRecipes::CLI
|
|
|
43
43
|
|
|
44
44
|
@input = gets.strip.downcase
|
|
45
45
|
|
|
46
|
-
if @input.to_i > 0
|
|
46
|
+
if @input.to_i > 0 && @input.to_i <= TopRecipes::Recipe.top_recipes.size
|
|
47
47
|
self.list_details
|
|
48
48
|
else
|
|
49
49
|
self.possible_commands
|
|
@@ -59,15 +59,15 @@ class TopRecipes::CLI
|
|
|
59
59
|
puts "Recipe by #{recipe.author}, rating is #{recipe.rating}"
|
|
60
60
|
self.line_break
|
|
61
61
|
puts "---------- Ingredients: ----------"
|
|
62
|
-
|
|
62
|
+
recipe.list_ingredients
|
|
63
63
|
self.line_break
|
|
64
64
|
puts "Directions are at the #{recipe.author}'s site:"
|
|
65
|
-
puts "#{recipe.directions}. Type 'open' to open the link, or any of our other helpful commands: #{self.commands_available}"
|
|
65
|
+
puts "#{recipe.directions}. Type 'open' to open the link of directions, or any of our other helpful commands: #{self.commands_available}"
|
|
66
66
|
|
|
67
67
|
@input = gets.strip
|
|
68
68
|
|
|
69
69
|
if @input.downcase.strip == "open"
|
|
70
|
-
|
|
70
|
+
recipe.open_directions_url
|
|
71
71
|
self.again_or_close
|
|
72
72
|
else
|
|
73
73
|
self.possible_commands
|
|
@@ -85,20 +85,13 @@ class TopRecipes::CLI
|
|
|
85
85
|
"'list recipes', 'joke', or 'exit'"
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
def self.list_ingredients(recipe)
|
|
89
|
-
recipe.ingredients.each.with_index(1) {|i, k| puts "#{k}. #{i}"}
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
|
|
93
88
|
def self.possible_commands
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
i = @input.downcase.strip
|
|
90
|
+
if ["list", "recipes", "recipe", "list recipes", "list recipe", "top recipes"].include? i
|
|
96
91
|
self.list_recipes
|
|
97
|
-
|
|
92
|
+
elsif ["joke", "jokes", "tell me a joke"].include? i
|
|
98
93
|
self.joke
|
|
99
|
-
|
|
100
|
-
self.exit_program
|
|
101
|
-
when "bye"
|
|
94
|
+
elsif ["exit", "bye", "exit!"].include? i
|
|
102
95
|
self.exit_program
|
|
103
96
|
else
|
|
104
97
|
self.no_match
|
data/lib/top_recipes/recipe.rb
CHANGED
data/lib/top_recipes/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: top-recipes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mxdavis
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-03-
|
|
11
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|