nutrition 1.0.2.pre → 1.0.3.pre

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nutrition/ingredient.rb +1 -1
  3. data/lib/nutrition/recipe.rb +21 -2
  4. metadata +33 -33
  5. /data/lib/nutrition/{ingredients → ingredient}/almond.rb +0 -0
  6. /data/lib/nutrition/{ingredients → ingredient}/basil_leaf.rb +0 -0
  7. /data/lib/nutrition/{ingredients → ingredient}/cheese.rb +0 -0
  8. /data/lib/nutrition/{ingredients → ingredient}/cheese_cottage.rb +0 -0
  9. /data/lib/nutrition/{ingredients → ingredient}/cheese_mozzarella.rb +0 -0
  10. /data/lib/nutrition/{ingredients → ingredient}/chicken_breast.rb +0 -0
  11. /data/lib/nutrition/{ingredients → ingredient}/cumin.rb +0 -0
  12. /data/lib/nutrition/{ingredients → ingredient}/egg.rb +0 -0
  13. /data/lib/nutrition/{ingredients → ingredient}/egg_white.rb +0 -0
  14. /data/lib/nutrition/{ingredients → ingredient}/flaxseed.rb +0 -0
  15. /data/lib/nutrition/{ingredients → ingredient}/flour_whole_wheat_pastry.rb +0 -0
  16. /data/lib/nutrition/{ingredients → ingredient}/garlic.rb +0 -0
  17. /data/lib/nutrition/{ingredients → ingredient}/garlic_powder.rb +0 -0
  18. /data/lib/nutrition/{ingredients → ingredient}/jalepeno.rb +0 -0
  19. /data/lib/nutrition/{ingredients → ingredient}/meat.rb +0 -0
  20. /data/lib/nutrition/{ingredients → ingredient}/milk_low_fat.rb +0 -0
  21. /data/lib/nutrition/{ingredients → ingredient}/nonstick_cooking_spray.rb +0 -0
  22. /data/lib/nutrition/{ingredients → ingredient}/olive_oil.rb +0 -0
  23. /data/lib/nutrition/{ingredients → ingredient}/onion.rb +0 -0
  24. /data/lib/nutrition/{ingredients → ingredient}/parmesan.rb +0 -0
  25. /data/lib/nutrition/{ingredients → ingredient}/peach.rb +0 -0
  26. /data/lib/nutrition/{ingredients → ingredient}/pepper.rb +0 -0
  27. /data/lib/nutrition/{ingredients → ingredient}/rice.rb +0 -0
  28. /data/lib/nutrition/{ingredients → ingredient}/salt.rb +0 -0
  29. /data/lib/nutrition/{ingredients → ingredient}/spinach.rb +0 -0
  30. /data/lib/nutrition/{ingredients → ingredient}/tomato_roma.rb +0 -0
  31. /data/lib/nutrition/{ingredients → ingredient}/water.rb +0 -0
  32. /data/lib/nutrition/{ingredients → ingredient}/yogurt.rb +0 -0
  33. /data/lib/nutrition/{recipes → recipe}/breakfast_muffin_cups_to_go.rb +0 -0
  34. /data/lib/nutrition/{recipes → recipe}/peaches_n_cream_parfait.rb +0 -0
  35. /data/lib/nutrition/{recipes → recipe}/tomato_pesto_egg_white_omelet.rb +0 -0
  36. /data/lib/nutrition/{recipes → recipe}/whole_wheat_crepes_florentine.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00df3e708d12fe07ff90b21e3a3cf275ed822fc4
4
- data.tar.gz: 72c94e98153e66e5a7eb03411a86f8d737024c60
3
+ metadata.gz: 372bdcebb1a6097af9b0e0f47e4ac062968ac20b
4
+ data.tar.gz: 2df7fb525707886fb0ea0c3ba00bde5e071ce26f
5
5
  SHA512:
6
- metadata.gz: b402bd7156afe3f9b78dbe66ad5c9ac67edf7b7aaa7676b731aa8fe2080f20f16e1207c3ad913ed9a4b88a88e772bdc43f648346d868404238b9cefb93986aca
7
- data.tar.gz: e6d113626ee2288830c96161d7e6cb630c5ac66ddffed8326fabdc46a2b64a6ea86cfddaef5f3f182451524c44c49eaf640fdafb5687727c05b0517c1c40f325
6
+ metadata.gz: f253d1a9577a38b698c411513aa48c0fb254f10f9b709860db027025ff8f3466f6c83f1115ab658ed4a4c41266a2ebb95594e3bc4d7048ce2ed45e634631a63e
7
+ data.tar.gz: 25308b3c1865ceb20c419ed4e163857322fa5b709b17d52a55d39cf11848f2f17693811a2bc48ba69cb6551c0f9db28711a6ffcb92406db247ba573eb1ec24e9
@@ -22,4 +22,4 @@ class Nutrition
22
22
  end
23
23
  end
24
24
 
25
- Dir["./lib/nutrition/ingredients/*.rb"].each {|file| require file }
25
+ Dir["./lib/nutrition/ingredient/*.rb"].each {|file| require file }
@@ -13,9 +13,27 @@ class Nutrition
13
13
  SOUP = 'Soup'
14
14
 
15
15
  def self.all
16
- Dir["./lib/nutrition/recipes/*.rb"].map { |file| file.to_s }
16
+ Dir["./lib/nutrition/recipe/*.rb"].map { |f| f.split("/")
17
+ .last
18
+ .gsub(".rb", "")
19
+ .gsub("_", "-") }
20
+ end
21
+
22
+ ##
23
+ # Nutrition::Recipe.find("breakfast-muffin-cups-to-go")
24
+ # =>
25
+ def self.find(slug)
26
+ klass = slug.split("-").map(&:capitalize).join("")
27
+ Nutrition::Recipe.const_get(klass).new
17
28
  end
18
29
 
30
+ ##
31
+ # Nutrition::Recipe.BreakfastMuffinCupsToGo.slug
32
+ # => "breakfast-muffin-cups-to-go"
33
+ def self.slug
34
+ self.to_s.split("::").last.gsub(/([^\^])([A-Z])/,'\1-\2').split("-").map(&:downcase).join("-")
35
+ end
36
+
19
37
  def tags
20
38
  []
21
39
  end
@@ -23,7 +41,8 @@ class Nutrition
23
41
  def to_s
24
42
  self.class.to_s.split("::").last.gsub(/([^\^])([A-Z])/,'\1 \2')
25
43
  end
44
+
26
45
  end
27
46
  end
28
47
 
29
- Dir["./lib/nutrition/recipes/*.rb"].each { |file| require file }
48
+ Dir["./lib/nutrition/recipe/*.rb"].each { |file| require file }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutrition
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2.pre
4
+ version: 1.0.3.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Teo Dell'Amico
@@ -18,40 +18,40 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - lib/nutrition.rb
20
20
  - lib/nutrition/ingredient.rb
21
- - lib/nutrition/ingredients/almond.rb
22
- - lib/nutrition/ingredients/basil_leaf.rb
23
- - lib/nutrition/ingredients/cheese.rb
24
- - lib/nutrition/ingredients/cheese_cottage.rb
25
- - lib/nutrition/ingredients/cheese_mozzarella.rb
26
- - lib/nutrition/ingredients/chicken_breast.rb
27
- - lib/nutrition/ingredients/cumin.rb
28
- - lib/nutrition/ingredients/egg.rb
29
- - lib/nutrition/ingredients/egg_white.rb
30
- - lib/nutrition/ingredients/flaxseed.rb
31
- - lib/nutrition/ingredients/flour_whole_wheat_pastry.rb
32
- - lib/nutrition/ingredients/garlic.rb
33
- - lib/nutrition/ingredients/garlic_powder.rb
34
- - lib/nutrition/ingredients/jalepeno.rb
35
- - lib/nutrition/ingredients/meat.rb
36
- - lib/nutrition/ingredients/milk_low_fat.rb
37
- - lib/nutrition/ingredients/nonstick_cooking_spray.rb
38
- - lib/nutrition/ingredients/olive_oil.rb
39
- - lib/nutrition/ingredients/onion.rb
40
- - lib/nutrition/ingredients/parmesan.rb
41
- - lib/nutrition/ingredients/peach.rb
42
- - lib/nutrition/ingredients/pepper.rb
43
- - lib/nutrition/ingredients/rice.rb
44
- - lib/nutrition/ingredients/salt.rb
45
- - lib/nutrition/ingredients/spinach.rb
46
- - lib/nutrition/ingredients/tomato_roma.rb
47
- - lib/nutrition/ingredients/water.rb
48
- - lib/nutrition/ingredients/yogurt.rb
21
+ - lib/nutrition/ingredient/almond.rb
22
+ - lib/nutrition/ingredient/basil_leaf.rb
23
+ - lib/nutrition/ingredient/cheese.rb
24
+ - lib/nutrition/ingredient/cheese_cottage.rb
25
+ - lib/nutrition/ingredient/cheese_mozzarella.rb
26
+ - lib/nutrition/ingredient/chicken_breast.rb
27
+ - lib/nutrition/ingredient/cumin.rb
28
+ - lib/nutrition/ingredient/egg.rb
29
+ - lib/nutrition/ingredient/egg_white.rb
30
+ - lib/nutrition/ingredient/flaxseed.rb
31
+ - lib/nutrition/ingredient/flour_whole_wheat_pastry.rb
32
+ - lib/nutrition/ingredient/garlic.rb
33
+ - lib/nutrition/ingredient/garlic_powder.rb
34
+ - lib/nutrition/ingredient/jalepeno.rb
35
+ - lib/nutrition/ingredient/meat.rb
36
+ - lib/nutrition/ingredient/milk_low_fat.rb
37
+ - lib/nutrition/ingredient/nonstick_cooking_spray.rb
38
+ - lib/nutrition/ingredient/olive_oil.rb
39
+ - lib/nutrition/ingredient/onion.rb
40
+ - lib/nutrition/ingredient/parmesan.rb
41
+ - lib/nutrition/ingredient/peach.rb
42
+ - lib/nutrition/ingredient/pepper.rb
43
+ - lib/nutrition/ingredient/rice.rb
44
+ - lib/nutrition/ingredient/salt.rb
45
+ - lib/nutrition/ingredient/spinach.rb
46
+ - lib/nutrition/ingredient/tomato_roma.rb
47
+ - lib/nutrition/ingredient/water.rb
48
+ - lib/nutrition/ingredient/yogurt.rb
49
49
  - lib/nutrition/plan.rb
50
50
  - lib/nutrition/recipe.rb
51
- - lib/nutrition/recipes/breakfast_muffin_cups_to_go.rb
52
- - lib/nutrition/recipes/peaches_n_cream_parfait.rb
53
- - lib/nutrition/recipes/tomato_pesto_egg_white_omelet.rb
54
- - lib/nutrition/recipes/whole_wheat_crepes_florentine.rb
51
+ - lib/nutrition/recipe/breakfast_muffin_cups_to_go.rb
52
+ - lib/nutrition/recipe/peaches_n_cream_parfait.rb
53
+ - lib/nutrition/recipe/tomato_pesto_egg_white_omelet.rb
54
+ - lib/nutrition/recipe/whole_wheat_crepes_florentine.rb
55
55
  - lib/nutrition/serving.rb
56
56
  homepage: http://rubygems.org/gems/nutrition
57
57
  licenses:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes