contentful-scheduler-custom 1.6.7.5329 → 1.6.7.5330
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 -23
- 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: 0e84ac860e666a9171bf00e0cd5042d9770bd73e9ba396fa7402d92eed087ffc
|
4
|
+
data.tar.gz: 323d479da76a1f5f4999a3f3bfecf1966c2247d92bf9273144d9c83b99fed960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71ccd5cd3fa2b4a376b7387cc0187edf4d917a0699f8448286841452a3ac75cef26dbef484d031d5c086df9cb9109455b8e6de056c74e8c7b7f674b032cd28d5
|
7
|
+
data.tar.gz: b055338781fe437a228c684fbe427df778bca4f3f3a2c57c3bd76c6cc936ffe52e6103a2c65d79ac33360adecea64244c8619e020b7142d3de0d40e0f88ec0a8
|
@@ -36,35 +36,36 @@ module Contentful
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
client.entries.find(space_id, entry_id).publish
|
39
|
-
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
def self.extract_element_ids input_array
|
41
|
+
ids = []
|
42
|
+
input_array.each {|item| (ids << (self.get_each_field item )).flatten!}
|
43
|
+
return ids.uniq
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
def self.get_each_field item
|
47
|
+
logger = Logger.new(STDOUT)
|
48
|
+
ids = []
|
49
|
+
keys = item["fields"].keys
|
50
|
+
keys.each {|key| (ids << (self.get_each_element key, item["fields"])).flatten!}
|
51
|
+
logger.info "get_each_field ==> #{ids}"
|
52
|
+
return ids1
|
53
|
+
end
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
55
|
+
def self.get_each_element key, item
|
56
|
+
logger = Logger.new(STDOUT)
|
57
|
+
ids = []
|
58
|
+
if item[key].is_a?(Array)
|
59
|
+
item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
|
60
|
+
elsif item[key].is_a?(Hash)
|
61
|
+
(!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
|
62
|
+
end
|
63
|
+
logger.info "get_each_element ids are ==> #{ids}"
|
64
|
+
return ids
|
63
65
|
end
|
64
|
-
logger.info "get_each_element ids are ==> #{ids2}"
|
65
|
-
return ids2
|
66
66
|
end
|
67
67
|
|
68
|
+
|
68
69
|
end
|
69
70
|
end
|
70
71
|
end
|