serious-eats 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6307524f0bb6c69512e1b4f28cb34fed4c73d22be9fc500737d44e66e241b111
4
- data.tar.gz: 0fe8e9242231e991fae1be06f6d7cc7b45e2e8a5a2d1c510cd9f7fcebf4322d6
3
+ metadata.gz: 6c54ec7f20769cb7f5a66680f04005132bfd05fdd7d63a0945a35ecb650db842
4
+ data.tar.gz: 22550e2b9a4c135270ded6bdd5a36819d98979195424e0607a9b3bdd6b445b10
5
5
  SHA512:
6
- metadata.gz: e5e34a3bbc6d67426f08eb9d0fac2e50f22e9b1146fdaed98807e0b416a663c0e02fe852339b9c28228bfffc55169736ff98fe6844ce69623ecb74357e8f941d
7
- data.tar.gz: 990ddf13f97673a5432f63e9c5cd942680b4d5162e5a4709a654804ab29c7c31f131fa4daf3eee3bd4ff641ab6369dd57c5d53683d155c1b799b2bf102bb7c3b
6
+ metadata.gz: 4b4e5cbf17e1f9630647005efb5fda4a6a1f94a37df3545f0b70266e277687513b8261d1941d20f76a2318bd48777bad0c3cb1e9bb4ba16505777a426d608dc7
7
+ data.tar.gz: 06c8f523e2020d34cc227e5f0e6a9482d4d6e1328ec640a11df635bc79dac8d5094d0603b9c14823eed6c0a733a141722fcaba0da9a9b4486296e1d447430f93
data/Gemfile.lock CHANGED
@@ -27,4 +27,4 @@ DEPENDENCIES
27
27
  serious-eats!
28
28
 
29
29
  BUNDLED WITH
30
- 1.16.4
30
+ 1.16.4
@@ -25,32 +25,32 @@ module SeriousEats
25
25
  end
26
26
 
27
27
  def fetch_recipe_data(recipe)
28
- get_recipe_data(recipe).map do |block|
29
- recipe.description = block.css(".recipe-introduction-body p:not(.caption)").map do |description|
30
- description.text.strip
31
- end.select do |description|
32
- # some recipes have some empty <p> tags that need to be filtered out
33
- description.length > 0
34
- end
28
+ block = get_recipe_data(recipe)
35
29
 
36
- recipe.portion = block.css("span.info.yield").text.strip
37
- recipe.active_time = block.css("ul.recipe-about li:nth-child(2) span.info").text.strip
38
- recipe.total_time = block.css("ul.recipe-about li:nth-child(3) span.info").text.strip
39
- recipe.rating = block.css("span.info.rating-value").text.strip.to_f.round(1)
30
+ recipe.description = block.css(".recipe-introduction-body p:not(.caption)").map do |description|
31
+ description.text.strip
32
+ end.select do |description|
33
+ # some recipes have some empty <p> tags that need to be filtered out
34
+ description.length > 0
35
+ end
40
36
 
41
- recipe.ingredients = block.css("li.ingredient").map do |ingredient|
42
- text = ingredient.text.strip
37
+ recipe.portion = block.css("span.info.yield").text.strip
38
+ recipe.active_time = block.css("ul.recipe-about li:nth-child(2) span.info").text.strip
39
+ recipe.total_time = block.css("ul.recipe-about li:nth-child(3) span.info").text.strip
40
+ recipe.rating = block.css("span.info.rating-value").text.strip.to_f.round(1)
43
41
 
44
- if ingredient.css("strong").any?
45
- text = "\n#{text.underline}"
46
- end
42
+ recipe.ingredients = block.css("li.ingredient").map do |ingredient|
43
+ text = ingredient.text.strip
47
44
 
48
- text
45
+ if ingredient.css("strong").any?
46
+ text = "\n#{text.underline}"
49
47
  end
50
48
 
51
- recipe.directions = block.css(".recipe-procedure-text").map do |direction|
52
- direction.text.strip
53
- end
49
+ text
50
+ end
51
+
52
+ recipe.directions = block.css(".recipe-procedure-text").map do |direction|
53
+ direction.text.strip
54
54
  end
55
55
  end
56
56
  end
@@ -1,3 +1,3 @@
1
1
  module SeriousEats
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serious-eats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alisa Cookie McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-06 00:00:00.000000000 Z
11
+ date: 2018-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler