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