daily_recipe 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcf285e5f75919c9d2db0b5993caac4099efab09
4
- data.tar.gz: e4b0fae69f6b29f82bf264c3a3a9a565f1219f91
3
+ metadata.gz: 0161fdc31de01687e7285bf574b60f10737be5d4
4
+ data.tar.gz: 97acceba362c0a6514fe154ea8818cb50ba66f13
5
5
  SHA512:
6
- metadata.gz: afc5367dfa9ea98d58d7abf2749cdd2a0cd30c9dd21da4d0b2edc3e82c3b40d7e6ea73ca2afeb3cf89c00d5b8452c001b4fe0724c701acce9c219e96b3c69bf6
7
- data.tar.gz: f9fca72f638a638a396571d3cab9dc9ee0cbbefa3f5cd51fd3149828d0e83f8cbfe1c60ad86f63bd0d167d65a8bed20429dac2e09dbc74e380d9d14ff5babbbc
6
+ metadata.gz: a5b3a1bb5e1ed3d66986fe6813cba971d61ba4380cff771671df3bf47ae3c0c1bb2a3e93b757019321e4f5e4f4c041bb336ec140642ef2e55a8cf564115710bf
7
+ data.tar.gz: f3e458d9574f5c6a4c9368f2e5b6b66137bea11d7f82e2c7624ab9f1786f1c0426d14132af28b5d5a6f740129f8d2ff9f0d53ddd9773585662881eb2092c11c8
data/bin/daily_recipe CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require './lib/daily_recipe'
3
+ require 'require_all'
4
+
5
+ require_rel '../lib'#'./lib/daily_recipe'
4
6
 
5
7
  DailyRecipe::CLI.new.call
@@ -2,7 +2,7 @@ require 'json'
2
2
  class DailyRecipe::Recipe
3
3
 
4
4
  attr_accessor :name, :cook_time, :rating, :api_id, :url
5
- BASE_URL = "http://www.foodnetwork.com"
5
+ @base_url = "http://www.foodnetwork.com"
6
6
  def self.today
7
7
  self.scrape_food_network
8
8
  end
@@ -15,7 +15,7 @@ class DailyRecipe::Recipe
15
15
  recipe.name = x.search("h6 a").text
16
16
  recipe.cook_time = x.search("dd").text
17
17
  recipe.api_id = (x.css("a.community-rating-stars").attribute("data-rating").value).scan(/\w+\-.+\w+/).join("-")
18
- recipe.url = BASE_URL + x.search(".community-rating-stars").attribute("href").value
18
+ recipe.url = @base_url + x.search(".community-rating-stars").attribute("href").value
19
19
  recipe.rating = get_rating(recipe.api_id)
20
20
  recipes << recipe
21
21
  end
@@ -31,7 +31,7 @@ class DailyRecipe::Recipe
31
31
  parsed = JSON.parse(part2, symbolize_names: true)
32
32
  rating = parsed[:streamInfo][:avgRatings][:_overall]
33
33
  rating
34
- end #Parses JSON to get access to the gigya API info in order to scrape the ratings information.
34
+ end #Parses JSON to get access to the gigya API info in order to scrape the ratings information.
35
35
 
36
36
  def self.scrape_full_recipe(the_recipe)
37
37
 
@@ -1,3 +1,3 @@
1
1
  module DailyRecipe
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daily_recipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian DeVivi