hangry 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hangry/canonical_url_parser.rb +6 -1
- data/lib/hangry/parser_class_selecter.rb +5 -1
- data/lib/hangry/parsers/non_standard/eating_well_parser.rb +46 -0
- data/lib/hangry/recipe_parser.rb +10 -0
- data/lib/hangry/version.rb +1 -1
- data/spec/fixtures/eatingwell.com.html +1743 -0
- data/spec/real_examples/eating_well_spec.rb +67 -0
- metadata +19 -14
@@ -0,0 +1,67 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'hangry'
|
3
|
+
|
4
|
+
describe Hangry do
|
5
|
+
|
6
|
+
context "bettycrocker.com recipe" do
|
7
|
+
let(:html) { File.read("spec/fixtures/eatingwell.com.html") }
|
8
|
+
subject { Hangry.parse(html) }
|
9
|
+
|
10
|
+
it "should use the correct parser" do
|
11
|
+
Hangry::ParserClassSelecter.new(html).parser_class.should == Hangry::Parsers::NonStandard::EatingWellParser
|
12
|
+
end
|
13
|
+
|
14
|
+
its(:author) { should == "From EatingWell" }
|
15
|
+
its(:canonical_url) { should == "http://www.eatingwell.com/recipes/sauteed_chicken_breasts_with_creamy_chive_sauce.html" }
|
16
|
+
its(:cook_time) { should == nil }
|
17
|
+
its(:description) { should == "Here's a sauce so delicious, it's missing only one thing: a little crunchy bread to dip in it. Make It a Meal: Serve with steamed asparagus or cauliflower, mashed potatoes or orzo pasta, and a glass of Vinho Verde." }
|
18
|
+
its(:ingredients) {
|
19
|
+
should == [
|
20
|
+
"4 boneless, skinless chicken breasts, (about 1 pound), trimmed of fat",
|
21
|
+
"1 teaspoon kosher salt, divided",
|
22
|
+
"1/4 cup plus 1 tablespoon all-purpose flour, divided",
|
23
|
+
"3 teaspoons extra-virgin olive oil, divided",
|
24
|
+
"2 large shallots, finely chopped",
|
25
|
+
"1/2 cup dry white wine",
|
26
|
+
"1 14-ounce can reduced-sodium chicken broth",
|
27
|
+
"1/3 cup reduced-fat sour cream",
|
28
|
+
"1 tablespoon Dijon mustard",
|
29
|
+
"1/2 cup chopped chives, (about 1 bunch)"
|
30
|
+
]
|
31
|
+
}
|
32
|
+
its(:name) { should == "Sauteed Chicken Breasts with Creamy Chive Sauce" }
|
33
|
+
its(:nutrition) do
|
34
|
+
should == {
|
35
|
+
calories: '244',
|
36
|
+
cholesterol: '72 mg cholesterol; 1 g carbohydrates; 26 g protein; 0 g fiber; 679 mg sodium; 334 mg potassium.',
|
37
|
+
fiber: '0 g',
|
38
|
+
protein: '26 g',
|
39
|
+
saturated_fat: '3 g',
|
40
|
+
sodium: '679 mg',
|
41
|
+
sugar: nil,
|
42
|
+
total_carbohydrates: '1 g',
|
43
|
+
total_fat: '9 g',
|
44
|
+
trans_fat: nil,
|
45
|
+
unsaturated_fat: nil
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
its(:instructions) {
|
50
|
+
instructions = <<-EOS
|
51
|
+
Place chicken between sheets of plastic wrap and pound with a meat mallet or heavy skillet until flattened to an even thickness, about 1/2 inch. Season both sides of the chicken with 1/2 teaspoon salt. Place 1/4 cup flour in a shallow glass baking dish and dredge the chicken in it. Discard the excess flour.
|
52
|
+
Heat 2 teaspoons oil in a large nonstick skillet over medium-high heat. Add the chicken and cook until golden brown, 1 to 2 minutes per side. Transfer to a plate, cover and keep warm.
|
53
|
+
Heat the remaining 1 teaspoon oil in the pan over medium-high heat. Add shallots and cook, stirring constantly and scraping up any browned bits, until golden brown, 1 to 2 minutes. Sprinkle with the remaining 1 tablespoon flour; stir to coat. Add wine, broth and the remaining 1/2 teaspoon salt; bring to a boil, stirring often.
|
54
|
+
Return the chicken and any accumulated juices to the pan, reduce heat to a simmer, and cook until heated through and no longer pink in the center, about 6 minutes. Stir in sour cream and mustard until smooth; turn the chicken to coat with the sauce. Stir in chives and serve immediately.
|
55
|
+
EOS
|
56
|
+
should == instructions.strip
|
57
|
+
}
|
58
|
+
|
59
|
+
its(:prep_time) { should == 35 }
|
60
|
+
its(:published_date) { should == nil }
|
61
|
+
its(:total_time) { should == 35 }
|
62
|
+
its(:yield) { should == "4 servings" }
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
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.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70341803937200 !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: *
|
24
|
+
version_requirements: *70341803937200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70341803936680 !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: *
|
35
|
+
version_requirements: *70341803936680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: pry
|
38
|
-
requirement: &
|
38
|
+
requirement: &70341803936200 !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: *
|
46
|
+
version_requirements: *70341803936200
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activesupport
|
49
|
-
requirement: &
|
49
|
+
requirement: &70341803935580 !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: *
|
57
|
+
version_requirements: *70341803935580
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: iso8601
|
60
|
-
requirement: &
|
60
|
+
requirement: &70341803934980 !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: *
|
68
|
+
version_requirements: *70341803934980
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: nokogiri
|
71
|
-
requirement: &
|
71
|
+
requirement: &70341803934460 !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: *
|
79
|
+
version_requirements: *70341803934460
|
80
80
|
description: A recipe microformat parser.
|
81
81
|
email:
|
82
82
|
- ian@iancanderson.com
|
@@ -99,12 +99,14 @@ files:
|
|
99
99
|
- lib/hangry/hrecipe_parser.rb
|
100
100
|
- lib/hangry/parser_class_selecter.rb
|
101
101
|
- lib/hangry/parsers/non_standard/all_recipes_parser.rb
|
102
|
+
- lib/hangry/parsers/non_standard/eating_well_parser.rb
|
102
103
|
- lib/hangry/recipe_parser.rb
|
103
104
|
- lib/hangry/schema_org_recipe_parser.rb
|
104
105
|
- lib/hangry/version.rb
|
105
106
|
- spec/fixtures/allrecipes.html
|
106
107
|
- spec/fixtures/betty_crocker.html
|
107
108
|
- spec/fixtures/bigoven.html
|
109
|
+
- spec/fixtures/eatingwell.com.html
|
108
110
|
- spec/fixtures/epicurious.html
|
109
111
|
- spec/fixtures/food_network_schema_org.html
|
110
112
|
- spec/fixtures/food_network_with_blank_ingredients.html
|
@@ -113,6 +115,7 @@ files:
|
|
113
115
|
- spec/real_examples/all_recipes_spec.rb
|
114
116
|
- spec/real_examples/betty_crocker_spec.rb
|
115
117
|
- spec/real_examples/big_oven_spec.rb
|
118
|
+
- spec/real_examples/eating_well_spec.rb
|
116
119
|
- spec/real_examples/epicurious_spec.rb
|
117
120
|
- spec/real_examples/food_network_spec.rb
|
118
121
|
- spec/real_examples/myrecipes_com_spec.rb
|
@@ -144,6 +147,7 @@ test_files:
|
|
144
147
|
- spec/fixtures/allrecipes.html
|
145
148
|
- spec/fixtures/betty_crocker.html
|
146
149
|
- spec/fixtures/bigoven.html
|
150
|
+
- spec/fixtures/eatingwell.com.html
|
147
151
|
- spec/fixtures/epicurious.html
|
148
152
|
- spec/fixtures/food_network_schema_org.html
|
149
153
|
- spec/fixtures/food_network_with_blank_ingredients.html
|
@@ -152,6 +156,7 @@ test_files:
|
|
152
156
|
- spec/real_examples/all_recipes_spec.rb
|
153
157
|
- spec/real_examples/betty_crocker_spec.rb
|
154
158
|
- spec/real_examples/big_oven_spec.rb
|
159
|
+
- spec/real_examples/eating_well_spec.rb
|
155
160
|
- spec/real_examples/epicurious_spec.rb
|
156
161
|
- spec/real_examples/food_network_spec.rb
|
157
162
|
- spec/real_examples/myrecipes_com_spec.rb
|