contentful-scheduler-custom 1.6.7.5312 → 1.6.7.5313

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: ff5ce7a955ebccff139639b5805c24105f257bfe50f4d6d4d36c757678006361
4
- data.tar.gz: 5a97eef6bfe850eff01def5174207e92250f1dcb65c7f451e471c6b2e25625f2
3
+ metadata.gz: b7b24efd03b619d9ef4938b784d369c085313b394b56b21ab5333bb2b38d3ee4
4
+ data.tar.gz: 35d227ab65cb463884429435d3613523edfac648fe479b1bc3aeff9b64cf0da0
5
5
  SHA512:
6
- metadata.gz: 963aa2753d548b4bf657aed48862763bddb137ba641051b1d6573528b1f9c36a733ea574fb781bb9cb8daf6880f321d0f09bfaa2132727df9e334fd52c5f0089
7
- data.tar.gz: 9c14a7a6e4a4b4ee9a49cb9d9282a97d15f76f6e8d916b769a9eb536a42945d7063b66c2bcefdba6e07acedb2f08b2750171bcc4c7052092171cc93ad29a3595
6
+ metadata.gz: e6cce7b5ae7138817f1da6bdb3f08caf99229446f992b088e0e4101ffd674e561cc19fff9c1641a2604f67f11fe0ee648779fd92b3c0f9598bd18b71077bc35c
7
+ data.tar.gz: 3fcb799772c86b184b7ea9e94db0e1d84dc6dceedcc2e61ad16bb5dc887ea05cdb2816e0dd5e8ee9dd3845968a16cc5b0c261e253d5cf18fcbb5f97ba7d0f675
@@ -11,29 +11,6 @@ module Contentful
11
11
 
12
12
  def self.perform(space_id, entry_id, token)
13
13
 
14
- def extract_element_ids(input_array)
15
- ids = []
16
- input_array.each {|item| (ids << (get_each_field item)).flatten!}
17
- ids.uniq
18
- end
19
-
20
- def get_each_field(item)
21
- ids = []
22
- keys = item["fields"].keys
23
- keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
24
- return ids
25
- end
26
-
27
- def get_each_element(key, item)
28
- ids = []
29
- if item[key].kind_of?(Array)
30
- item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
31
- elsif item[key].kind_of?(Hash)
32
- (!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
33
- end
34
- return ids
35
- end
36
-
37
14
  logger = Logger.new(STDOUT)
38
15
  client1 = Contentful::Client.new(
39
16
  space: space_id,
@@ -60,31 +37,30 @@ module Contentful
60
37
  end
61
38
 
62
39
 
40
+ client.entries.find(space_id, entry_id).publish
41
+ end
63
42
 
64
- =begin
65
- linked_enteries.each do |entry|
66
- logger.info "Enteries are ===>>>> #{entry.raw}"
67
- end
43
+ def self.extract_element_ids(input_array)
44
+ ids = []
45
+ input_array.each {|item| (ids << (get_each_field item)).flatten!}
46
+ return ids.uniq
47
+ end
68
48
 
49
+ def self.get_each_field(item)
50
+ ids = []
51
+ keys = item["fields"].keys
52
+ keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
53
+ return ids
54
+ end
69
55
 
70
- linked_enteries.items.each do |entry|
71
- logger.info "Ruby raw element is ==> #{entry.raw}"
72
- entry.fields.each do |fields|
73
- logger.info "items fields class is #{fields}"
74
- fields.each do |field|
75
- logger.info "items FIELD class is #{field.class.to_s}"
76
- if !field.nil? && field.class.to_s == "Array"
77
- logger.info " items field ids are #{field}"
78
- field.each do |entry1|
79
- logger.info"under 1 level #{entry1.fields}"
80
- end
81
- end
82
- end
83
- end
56
+ def self.get_each_element(key, item)
57
+ ids = []
58
+ if item[key].kind_of?(Array)
59
+ item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
60
+ elsif item[key].kind_of?(Hash)
61
+ (!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
84
62
  end
85
- =end
86
-
87
- client.entries.find(space_id, entry_id).publish
63
+ return ids
88
64
  end
89
65
  end
90
66
  end
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.6.7.5312"
3
+ VERSION = "1.6.7.5313"
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.5312
4
+ version: 1.6.7.5313
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0