contentful-scheduler-custom 1.6.7.5306 → 1.6.7.5307
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contentful/scheduler/tasks/publish.rb +24 -22
- data/lib/contentful/scheduler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a566cc65725611103658c94e15ff9739a217aa441f2375f333177526c43865d2
|
4
|
+
data.tar.gz: be86aa3f4cc2107edfce7143c24995b92e408139c2fa11558e41b6f53f93fe16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc51500e74e73ce938248626e36e892ac5b6db9ea78c06e5b430d2712342f7ef0cf92bd9de5c468947591f7e2f9583945908dad19af62bcb4f7e086f84f4b8de
|
7
|
+
data.tar.gz: 12e36dbd4135b4dfa83f069bb24dc53084257a8c22afe30225bd4a1eabd1afe23e78113a8e93849c60513e01df67a8fb1ab9ee1d4a654fafb7dcc7fc484a0c2d
|
@@ -36,6 +36,30 @@ module Contentful
|
|
36
36
|
end
|
37
37
|
|
38
38
|
|
39
|
+
def extract_element_ids(input_array)
|
40
|
+
ids = []
|
41
|
+
input_array.each {|item| (ids << (get_each_field item)).flatten!}
|
42
|
+
ids.uniq
|
43
|
+
end
|
44
|
+
|
45
|
+
def get_each_field(item)
|
46
|
+
ids = []
|
47
|
+
keys = item["fields"].keys
|
48
|
+
keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
|
49
|
+
return ids
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_each_element(key, item)
|
53
|
+
ids = []
|
54
|
+
if item[key].kind_of?(Array)
|
55
|
+
item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
|
56
|
+
elsif item[key].kind_of?(Hash)
|
57
|
+
(!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
|
58
|
+
end
|
59
|
+
return ids
|
60
|
+
end
|
61
|
+
|
62
|
+
|
39
63
|
|
40
64
|
|
41
65
|
=begin
|
@@ -65,28 +89,6 @@ module Contentful
|
|
65
89
|
end
|
66
90
|
|
67
91
|
|
68
|
-
def extract_element_ids(input_array)
|
69
|
-
ids = []
|
70
|
-
input_array.each {|item| (ids << (get_each_field item)).flatten!}
|
71
|
-
ids.uniq
|
72
|
-
end
|
73
|
-
|
74
|
-
def get_each_field(item)
|
75
|
-
ids = []
|
76
|
-
keys = item["fields"].keys
|
77
|
-
keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
|
78
|
-
return ids
|
79
|
-
end
|
80
|
-
|
81
|
-
def get_each_element(key, item)
|
82
|
-
ids = []
|
83
|
-
if item[key].kind_of?(Array)
|
84
|
-
item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
|
85
|
-
elsif item[key].kind_of?(Hash)
|
86
|
-
(!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
|
87
|
-
end
|
88
|
-
return ids
|
89
|
-
end
|
90
92
|
|
91
93
|
end
|
92
94
|
end
|