fetcher-microdata 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Fetcher
2
2
  class Microdata
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.13"
4
4
  end
5
5
  end
@@ -42,6 +42,12 @@ module Writer
42
42
  @attributes[:comments].each do |c|
43
43
  resp["properties"]["UserComments"].push c.to.hash
44
44
  end
45
+
46
+ resp["properties"].keys.each do |att|
47
+ if resp["properties"]["#{att}"] == [nil]
48
+ resp["properties"].delete "#{att}"
49
+ end
50
+ end
45
51
  resp
46
52
 
47
53
  end
@@ -10,7 +10,7 @@ module Writer
10
10
 
11
11
  def hash
12
12
  @attributes = @source.attributes
13
- {
13
+ resp = {
14
14
  "type" => [@source._type],
15
15
  "properties" => {
16
16
  "additionalType" => [
@@ -40,6 +40,14 @@ module Writer
40
40
  ]
41
41
  }
42
42
  }
43
+
44
+ resp["properties"].keys.each do |att|
45
+ if resp["properties"]["#{att}"] == [nil]
46
+ resp["properties"].delete "#{att}"
47
+ end
48
+ end
49
+ resp
50
+
43
51
  end
44
52
  end
45
53
  end
@@ -12,7 +12,7 @@ module Writer
12
12
  @attributes = @source.attributes
13
13
  aux = @attributes[:id].split("_")
14
14
  url = "https://www.facebook.com/#{aux[1]}?comment_id=#{aux[2]}"
15
- {
15
+ resp = {
16
16
  "type" => [@source._type],
17
17
  "properties" => {
18
18
  "additionalType" => [
@@ -34,8 +34,15 @@ module Writer
34
34
  url
35
35
  ]
36
36
  }
37
-
38
37
  }
38
+
39
+ resp["properties"].keys.each do |att|
40
+ if resp["properties"]["#{att}"] == [nil]
41
+ resp["properties"].delete "#{att}"
42
+ end
43
+ end
44
+ resp
45
+
39
46
  end
40
47
  end
41
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fetcher-microdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: