tee_reverser 0.0.2 → 0.0.3

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.
data/lib/tee_reverser.rb CHANGED
@@ -1,35 +1,38 @@
1
1
  require 'yummly'
2
- require './tee_reverser/reverser.rb'
3
- require './tee_reverser/recipe_list.rb'
4
- require './tee_reverser/pantry.rb'
5
2
 
6
3
  module TeeReverser
7
- Yummly.configure do |config|
8
- config.app_id = "bddcbcff"
9
- config.app_key = "9245c33f2cc6d6bedb65715d3fb66c61"
10
- end
11
- puts "Please give me the filepath of your pantry list, in .txt format."
12
- puts "Your list will ideally have any each ingredient you wish to itemize in its own line."
13
- location = gets.chomp
14
- #ensures only proper objects get loaded
15
- until /.txt/.match(location.to_str) && File.exists?("#{location}") do
16
- puts "Please give me a valid filepath and name. File must exist and be in *.txt format."
17
- location = gets.chomp
18
- end
19
- goods = Pantry.new(location)
20
- goods.parse
21
- puts "What kind of dish would you like to make?"
22
- wishlist = gets.chomp
23
- puts " "
24
- puts "-------------------C O N N E C T I N G---------------------"
25
- puts " "
26
- query = Yummly.search("#{wishlist}")
27
- meal = RecipeList.new(query)
28
- meal.listbuilder
29
- puts " "
30
- puts "---------------------T H I N K I N G-----------------------"
31
- puts " "
32
- decisions = Reverser.new(goods.list, meal.recipehash)
33
- decisions.reverse
34
- decisions.choose
4
+ require 'tee_reverser/reverser.rb'
5
+ require 'tee_reverser/recipe_list.rb'
6
+ require 'tee_reverser/pantry.rb'
7
+ require 'tee_reverser/execute.rb'
8
+
9
+
10
+ # Yummly.configure do |config|
11
+ # config.app_id = "bddcbcff"
12
+ # config.app_key = "9245c33f2cc6d6bedb65715d3fb66c61"
13
+ # end
14
+ # puts "Please give me the filepath of your pantry list, in .txt format."
15
+ # puts "Your list will ideally have any each ingredient you wish to itemize in its own line."
16
+ # location = gets.chomp
17
+ # #ensures only proper objects get loaded
18
+ # until /.txt/.match(location.to_str) && File.exists?("#{location}") do
19
+ # puts "Please give me a valid filepath and name. File must exist and be in *.txt format."
20
+ # location = gets.chomp
21
+ # end
22
+ # goods = Pantry.new(location)
23
+ # goods.parse
24
+ # puts "What kind of dish would you like to make?"
25
+ # wishlist = gets.chomp
26
+ # puts " "
27
+ # puts "-------------------C O N N E C T I N G---------------------"
28
+ # puts " "
29
+ # query = Yummly.search("#{wishlist}")
30
+ # meal = RecipeList.new(query)
31
+ # meal.listbuilder
32
+ # puts " "
33
+ # puts "---------------------T H I N K I N G-----------------------"
34
+ # puts " "
35
+ # decisions = Reverser.new(goods.list, meal.recipehash)
36
+ # decisions.reverse
37
+ # decisions.choose
35
38
  end
@@ -0,0 +1,34 @@
1
+ module TeeReverser
2
+
3
+ def execute
4
+ Yummly.configure do |config|
5
+ config.app_id = "bddcbcff"
6
+ config.app_key = "9245c33f2cc6d6bedb65715d3fb66c61"
7
+ end
8
+ puts "Please give me the filepath of your pantry list, in .txt format."
9
+ puts "Your list will ideally have any each ingredient you wish to itemize in its own line."
10
+ location = gets.chomp
11
+ #ensures only proper objects get loaded
12
+ until /.txt/.match(location.to_str) && File.exists?("#{location}") do
13
+ puts "Please give me a valid filepath and name. File must exist and be in *.txt format."
14
+ location = gets.chomp
15
+ end
16
+ goods = Pantry.new(location)
17
+ goods.parse
18
+ puts "What kind of dish would you like to make?"
19
+ wishlist = gets.chomp
20
+ puts " "
21
+ puts "-------------------C O N N E C T I N G---------------------"
22
+ puts " "
23
+ query = Yummly.search("#{wishlist}")
24
+ meal = RecipeList.new(query)
25
+ meal.listbuilder
26
+ puts " "
27
+ puts "---------------------T H I N K I N G-----------------------"
28
+ puts " "
29
+ decisions = Reverser.new(goods.list, meal.recipehash)
30
+ decisions.reverse
31
+ decisions.choose
32
+ end
33
+
34
+ end
@@ -2,5 +2,5 @@
2
2
  # Copyright © 2013, stevenbxu
3
3
 
4
4
  module TeeReverser
5
- VERSION = "0.0.2"
5
+ VERSION = "0.0.3"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tee_reverser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/tee_reverser.rb
21
+ - lib/tee_reverser/execute.rb
21
22
  - lib/tee_reverser/pantry.rb
22
23
  - lib/tee_reverser/recipe_list.rb
23
24
  - lib/tee_reverser/reverser.rb