hangry 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ module Hangry
20
20
  end
21
21
 
22
22
  def parse_instructions
23
- clean_string node_with_itemprop(:instructions).content
23
+ clean_string node_with_itemprop(:instructions).content, preserve_newlines: true
24
24
  end
25
25
 
26
26
  def parse_published_date
@@ -43,7 +43,7 @@ module Hangry
43
43
  end
44
44
 
45
45
  def parse_instructions
46
- clean_string node_with_class(:instructions).content
46
+ clean_string node_with_class(:instructions).content, preserve_newlines: true
47
47
  end
48
48
 
49
49
  def parse_name
@@ -47,8 +47,17 @@ module Hangry
47
47
  end
48
48
  end
49
49
 
50
- def clean_string(string)
51
- string.strip.gsub(/\s+/, ' ')
50
+ def clean_string(string, options={})
51
+ preserve_newlines = options.fetch(:preserve_newlines, false)
52
+
53
+ string.strip! # remove leading and trailing spaces
54
+ if preserve_newlines
55
+ string.gsub!(/\s*\n\s*/, "\n") # replace any whitespace group with a newline with a single newline
56
+ string.squeeze!(' ') # consolidate duplicate spaces into a single space
57
+ else
58
+ string.gsub!(/\s+/, ' ') # replace all consecutive whitespace with a single space
59
+ end
60
+ string
52
61
  end
53
62
 
54
63
  def initialize_nutrition
@@ -50,7 +50,7 @@ module Hangry
50
50
  end
51
51
  end
52
52
  def parse_instructions
53
- clean_string node_with_itemprop(:recipeInstructions).content
53
+ clean_string node_with_itemprop(:recipeInstructions).content, preserve_newlines: true
54
54
  end
55
55
  def parse_name
56
56
  clean_string node_with_itemprop(:name).content
@@ -1,3 +1,3 @@
1
1
  module Hangry
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -24,7 +24,17 @@ describe Hangry do
24
24
  }
25
25
  its(:instructions) do
26
26
  instructions = <<-eos
27
- As with any recipe, adaptation to your taste is the key to success and your culinary enjoyment. This recipe is a preparation of optional ingredients, then you build the tacos as you like them. 1. Cut across the cabbage on the end opposite the stem in 1/4 inch rounds, then turn the rings and cut again to shred into small bite size pieces. Place the cabbage in a gallon freezer bag. Add 1 tablespoon of lime juice, the vinegar and season with salt pepper, cumin and coriander as you like. Shake the bag every direction to mix the ingredients and let sit while you prepare everything else. 2. For the fish - Cut the fish into fillets that you will later pull apart with two forks. Mix the egg and milk together. Mix the flour and cornmeal, and add seasonings that you like. I have a 22 herb/spice mix that I've come up with that I mix in with the flour and corn meal. Coriander, cumin, salt and pepper, garlic and onion powder are a good start. I'll post the mix as a separate recipe. 3. Bathe the fish in the mile/egg mixture, and dredge in the flour/seasoning mixture on both sides. Set aside until all the fish is ready. 4. Heat the oil or butter in a pan on medium high, and cook the fish, about 4 minutes per side. Take the fish out of the pan with tongs, set on a cutting board and squeeze lime juice over it. Let it cool. 5. Prepare the tomato, onion and cilantro and set out in small bowls. Mix the salsa of your choice and sour cream. 6. When the fish has cooled, use one fork to anchor it and shred with the another, flaking off small pieces. Place in a bowl. 7. Set out the cabbage in a small bowl. 8. Heat the tortillas in a microwave. Place two on a plate, and build up your tacos with sour cream mix, fish, onion, tomato, tomato, jalapenos, hot sauce - whatever you like! Fold over and dig in, with a nice IPA or crisp white wine!
27
+ As with any recipe, adaptation to your taste is the key to success and your culinary enjoyment.
28
+ This recipe is a preparation of optional ingredients, then you build the tacos as you like them.
29
+ 1. Cut across the cabbage on the end opposite the stem in 1/4 inch rounds, then turn the rings and cut again to shred into small bite size pieces. Place the cabbage in a gallon freezer bag. Add 1 tablespoon of lime juice, the vinegar and season with salt pepper, cumin and coriander as you like. Shake the bag every direction to mix the ingredients and let sit while you prepare everything else.
30
+ 2. For the fish - Cut the fish into fillets that you will later pull apart with two forks. Mix the egg and milk together. Mix the flour and cornmeal, and add seasonings that you like. I have a 22 herb/spice mix that I've come up with that I mix in with the flour and corn meal. Coriander, cumin, salt and pepper, garlic and onion powder are a good start. I'll post the mix as a separate recipe.
31
+ 3. Bathe the fish in the mile/egg mixture, and dredge in the flour/seasoning mixture on both sides. Set aside until all the fish is ready.
32
+ 4. Heat the oil or butter in a pan on medium high, and cook the fish, about 4 minutes per side. Take the fish out of the pan with tongs, set on a cutting board and squeeze lime juice over it. Let it cool.
33
+ 5. Prepare the tomato, onion and cilantro and set out in small bowls. Mix the salsa of your choice and sour cream.
34
+ 6. When the fish has cooled, use one fork to anchor it and shred with the another, flaking off small pieces. Place in a bowl.
35
+ 7. Set out the cabbage in a small bowl.
36
+ 8. Heat the tortillas in a microwave. Place two on a plate, and build up your tacos with sour cream mix, fish, onion, tomato, tomato, jalapenos, hot sauce - whatever you like!
37
+ Fold over and dig in, with a nice IPA or crisp white wine!
28
38
  eos
29
39
  should == instructions.strip
30
40
  end
@@ -31,8 +31,17 @@ describe Hangry do
31
31
  }
32
32
 
33
33
  its(:instructions) do
34
+ # hmm... preserving newlines for Epicurious instructions gives us some crappy results...
34
35
  instructions = <<-eos
35
- Preparation Toast cumin seeds and coriander seeds in small skillet over medium-high heat until aromatic and slightly darker in color, shaking skillet often, about 1 1/2 minutes. Cool. Finely grind toasted seeds in spice grinder or in mortar with pestle. Whisk mayonnaise, 2 tablespoons extra-virgin olive oil, fresh lemon juice, smoked paprika, garlic, and ground spices in small bowl. Season aioli to taste with salt and pepper. DO AHEAD: Aioli can be made 1 day ahead. Cover and refrigerate. Place turkey in medium bowl. Add 2 tablespoons aioli; mix gently. Using damp hands, divide turkey mixture into 4 equal portions, then form each into scant 3/4-inch thick patty, about 3 1/2 inches in diameter. Using thumb, make small indentation in center of each burger. DO AHEAD: Can be made 4 hours ahead. Cover and chill. Prepare barbecue (medium-high heat). Sprinkle burgers with salt and pepper. Brush onion slices and bell pepper pieces with oil; sprinkle with salt and pepper. Grill onions and bell peppers until soft and charred, about 4 minutes per side. Grill turkey burgers 5 minutes. Turn over; grill until almost cooked through, about 4 minutes. Top each burger with 1 cheese slice and grill until meat is cooked through and cheese melts, about 1 minute longer. Place 1 turkey burger on each of 4 bun bottoms. Arrange grilled red pepper pieces, then grilled red onion slices over. Top each with dollop of aioli and some arugula. Cover burgers with bun tops and serve with pickle wedges and corn chips. add your own note
36
+ Preparation
37
+ Toast cumin seeds and coriander seeds in small skillet over medium-high heat
38
+ until aromatic and slightly darker in color, shaking skillet often, about 1 1/2 minutes. Cool. Finely grind toasted seeds in spice grinder or in mortar with pestle. Whisk mayonnaise, 2 tablespoons extra-virgin olive oil, fresh lemon juice, smoked paprika, garlic, and ground spices in small bowl. Season aioli to taste with salt and pepper. DO AHEAD: Aioli can be made 1 day ahead. Cover and refrigerate.
39
+ Place turkey in medium bowl. Add 2 tablespoons aioli; mix gently. Using damp
40
+ hands, divide turkey mixture into 4 equal portions, then form each into scant 3/4-inch thick patty, about 3 1/2 inches in diameter. Using thumb, make small indentation in center of each burger. DO AHEAD: Can be made 4 hours ahead. Cover and chill.
41
+ Prepare barbecue (medium-high heat). Sprinkle burgers with salt and pepper. Brush onion slices and bell pepper pieces with oil; sprinkle with salt and pepper. Grill onions and bell peppers until soft and charred, about 4 minutes per side.
42
+ Grill turkey burgers 5 minutes. Turn over; grill until almost cooked through,
43
+ about 4 minutes. Top each burger with 1 cheese slice and grill until meat is cooked through and cheese melts, about 1 minute longer. Place 1 turkey burger on each of 4 bun bottoms. Arrange grilled red pepper pieces, then grilled red onion slices over. Top each with dollop of aioli and some arugula. Cover burgers with bun tops and serve with pickle wedges and corn chips.
44
+ add your own note
36
45
  eos
37
46
  should == instructions.strip
38
47
  end
@@ -31,7 +31,10 @@ describe Hangry do
31
31
 
32
32
  its(:instructions) do
33
33
  instructions = <<-instructions
34
- Place breasts in the center of a plastic food storage bag or 2 large sheets of waxed paper. Pound out the chicken from the center of the bag outward using a heavy-bottomed skillet or mallet. Be firm but controlled with your strokes. Defrost spinach in the microwave. Transfer spinach to a kitchen towel. Twist towel around spinach and wring it out until very dry. Transfer to a medium-mixing bowl. Place a nonstick skillet over moderate heat. When skillet is hot, add butter, mushrooms, garlic and shallot. Season with salt and pepper and saute 5 minutes. Transfer mushrooms, garlic and shallot to the food processor. Pulse to grind the mushrooms and transfer to the mixing bowl, adding the processed mushrooms to the spinach. Add ricotta and grated cheese to the bowl and the nutmeg. Stir to combine the stuffing. Return your skillet to the stove over medium high heat. Place a mound of stuffing on each breast and wrap and roll breast over the stuffing. Secure breasts with toothpicks. Add 3 tablespoons oil to the pan, 3 turns of the pan. Add breasts to the pan and brown on all sides, cooking chicken 10 to 12 minutes. The meat will cook quickly because it is thin. Remove breasts; add butter to the pan and flour. Cook butter and flour for a minute, whisk in wine and reduce another minute. Whisk in broth and return breasts to the pan. Reduce heat and simmer until ready to serve. Remove toothpicks. Serve breasts whole or, remove from pan, slice on an angle and fan out on dinner plates. Top stuffed chicken breasts or sliced stuffed breasts with generous spoonfuls of the sauce.
34
+ Place breasts in the center of a plastic food storage bag or 2 large sheets of waxed paper. Pound out the chicken from the center of the bag outward using a heavy-bottomed skillet or mallet. Be firm but controlled with your strokes.
35
+ Defrost spinach in the microwave. Transfer spinach to a kitchen towel. Twist towel around spinach and wring it out until very dry. Transfer to a medium-mixing bowl.
36
+ Place a nonstick skillet over moderate heat. When skillet is hot, add butter, mushrooms, garlic and shallot. Season with salt and pepper and saute 5 minutes. Transfer mushrooms, garlic and shallot to the food processor. Pulse to grind the mushrooms and transfer to the mixing bowl, adding the processed mushrooms to the spinach. Add ricotta and grated cheese to the bowl and the nutmeg. Stir to combine the stuffing. Return your skillet to the stove over medium high heat.
37
+ Place a mound of stuffing on each breast and wrap and roll breast over the stuffing. Secure breasts with toothpicks. Add 3 tablespoons oil to the pan, 3 turns of the pan. Add breasts to the pan and brown on all sides, cooking chicken 10 to 12 minutes. The meat will cook quickly because it is thin. Remove breasts; add butter to the pan and flour. Cook butter and flour for a minute, whisk in wine and reduce another minute. Whisk in broth and return breasts to the pan. Reduce heat and simmer until ready to serve. Remove toothpicks. Serve breasts whole or, remove from pan, slice on an angle and fan out on dinner plates. Top stuffed chicken breasts or sliced stuffed breasts with generous spoonfuls of the sauce.
35
38
  instructions
36
39
  should == instructions.strip
37
40
  end
@@ -19,7 +19,10 @@ describe Hangry do
19
19
  }
20
20
  its(:instructions) do
21
21
  instructions = <<-eos
22
- Line 3 (9-inch) round cakepans with wax paper; lightly grease and flour wax paper. Set pans aside. Stir together first 4 ingredients. Beat eggs and next 4 ingredients at medium speed with an electric mixer until smooth. Add flour mixture, beating at low speed until blended. Fold in carrot and next 3 ingredients. Pour batter into prepared cakepans. Bake at 350° for 25 to 30 minutes or until a wooden pick inserted in center comes out clean. Drizzle Buttermilk Glaze evenly over layers; cool in pans on wire racks 15 minutes. Remove from pans, and cool completely on wire racks. Spread Cream Cheese Frosting between layers and on top and sides of cake.
22
+ Line 3 (9-inch) round cakepans with wax paper; lightly grease and flour wax paper. Set pans aside.
23
+ Stir together first 4 ingredients.
24
+ Beat eggs and next 4 ingredients at medium speed with an electric mixer until smooth. Add flour mixture, beating at low speed until blended. Fold in carrot and next 3 ingredients. Pour batter into prepared cakepans.
25
+ Bake at 350° for 25 to 30 minutes or until a wooden pick inserted in center comes out clean. Drizzle Buttermilk Glaze evenly over layers; cool in pans on wire racks 15 minutes. Remove from pans, and cool completely on wire racks. Spread Cream Cheese Frosting between layers and on top and sides of cake.
23
26
  eos
24
27
  should == instructions.strip
25
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hangry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-03-11 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70299202813480 !ruby/object:Gem::Requirement
16
+ requirement: &70141407538320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70299202813480
24
+ version_requirements: *70141407538320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70299202812940 !ruby/object:Gem::Requirement
27
+ requirement: &70141407537900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70299202812940
35
+ version_requirements: *70141407537900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: pry
38
- requirement: &70299202812440 !ruby/object:Gem::Requirement
38
+ requirement: &70141407537460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70299202812440
46
+ version_requirements: *70141407537460
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activesupport
49
- requirement: &70299202811840 !ruby/object:Gem::Requirement
49
+ requirement: &70141407536960 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '3.0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70299202811840
57
+ version_requirements: *70141407536960
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: iso8601
60
- requirement: &70299202811260 !ruby/object:Gem::Requirement
60
+ requirement: &70141407536420 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.4.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70299202811260
68
+ version_requirements: *70141407536420
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
- requirement: &70299202810720 !ruby/object:Gem::Requirement
71
+ requirement: &70141407535940 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '1.5'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70299202810720
79
+ version_requirements: *70141407535940
80
80
  description: A recipe microformat parser.
81
81
  email:
82
82
  - ian@iancanderson.com