contentful-scheduler-custom 1.6.7.5308 → 1.6.7.5309

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
  SHA256:
3
- metadata.gz: 4588d74ca10e07dd0fdd35dbc592d35bdf9c52b3e3a71ae401281d080c13e501
4
- data.tar.gz: 6630ebbe7ecabce90f3e10b0a124c6842a6a8d9e8b9e49f2134aa92929d24c6c
3
+ metadata.gz: 10d9cd5b89a0c102f912c2c48d5d6b70b8e88a5241c228d91c63540dbcb4361b
4
+ data.tar.gz: 2c1280178d8c0dfbe71bf3182f131fda6da00bffe9d078378822ab1d56b05c62
5
5
  SHA512:
6
- metadata.gz: 6d4d3fe8cf8862ba6d8617c9b760ef261cadf1c8f6c10cae86a5e8d2040aedb7440be15ea7fcabb2aef0889a7ae0fa1ece664156067a87a4c5a0b623b2308c41
7
- data.tar.gz: 448adb03d10b343e08872dee29c1d9388d6609624b295d919e59e8a6fb7d95824c8100f83c15c8e1f91faf9991447675fd4ebf57328d5698001adb3249fb4e64
6
+ metadata.gz: 4963f0c66de120018e76aec55e6bc5de9f92343f67daa37a26d685a841cc158f7ef86e7ec6dc9b6bf7e1b8ded83a74de888fba055e7cbd676e9c8c4923a50103
7
+ data.tar.gz: e47b075ce5714587ec2ee6d38ae3c9138c09b79cbfb0308e2b4288408059fbb5eec676fc3cbd7e5461b5e698d70a23a64316983a87fa2229594490fcfa33a474
@@ -9,6 +9,29 @@ module Contentful
9
9
  class Publish
10
10
  @queue = :publish
11
11
 
12
+ def extract_element_ids(input_array)
13
+ ids = []
14
+ input_array.each {|item| (ids << (get_each_field item)).flatten!}
15
+ ids.uniq
16
+ end
17
+
18
+ def get_each_field(item)
19
+ ids = []
20
+ keys = item["fields"].keys
21
+ keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
22
+ return ids
23
+ end
24
+
25
+ def get_each_element(key, item)
26
+ ids = []
27
+ if item[key].kind_of?(Array)
28
+ item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
29
+ elsif item[key].kind_of?(Hash)
30
+ (!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
31
+ end
32
+ return ids
33
+ end
34
+
12
35
  def self.perform(space_id, entry_id, token)
13
36
  logger = Logger.new(STDOUT)
14
37
  client1 = Contentful::Client.new(
@@ -36,31 +59,6 @@ module Contentful
36
59
  end
37
60
 
38
61
 
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
-
63
-
64
62
 
65
63
  =begin
66
64
  linked_enteries.each do |entry|
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.6.7.5308"
3
+ VERSION = "1.6.7.5309"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-scheduler-custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.7.5308
4
+ version: 1.6.7.5309
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0