contentful-scheduler-custom 1.6.7.5375 → 1.6.111
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e31b174381d677473cd07b1f9f370ea57804db5249bcf2c063f8c8615c65909f
|
4
|
+
data.tar.gz: 11ae67a10a789b63ac5372eb7d763d27a1987707940c7edc6889bc6497c043f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4c9a24329110a963e57b18fffc2e3b93d2bfbc3e959174af358eeb7b8f247298b310bdc6b8d2cf0b0711318a36ba3a0c16be04b752a1af69af44d70371d827f
|
7
|
+
data.tar.gz: 90c013733e74672abca20d9c787dfb4c2c143b15bed9564a453e19365122f552cac1397aff5cc6303d4d0abd5284d57a7f2ca7582927c2c2d1c4bcc54eca9937
|
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_runtime_dependency "contentful", "~> 2.11.1"
|
23
22
|
spec.add_runtime_dependency "contentful-webhook-listener", "~> 0.2"
|
23
|
+
spec.add_runtime_dependency "contentful", "~> 2.9.4"
|
24
24
|
spec.add_runtime_dependency "contentful-management", "~> 1.8"
|
25
25
|
spec.add_runtime_dependency "resque", "~> 1.27.4"
|
26
26
|
spec.add_runtime_dependency "resque-scheduler", "~> 4.3.1"
|
@@ -1,7 +1,5 @@
|
|
1
1
|
require 'contentful/management'
|
2
2
|
require 'contentful'
|
3
|
-
require 'logger'
|
4
|
-
require_relative '../taskshelper'
|
5
3
|
|
6
4
|
module Contentful
|
7
5
|
module Scheduler
|
@@ -10,33 +8,22 @@ module Contentful
|
|
10
8
|
@queue = :publish
|
11
9
|
|
12
10
|
def self.perform(space_id, entry_id, token)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
space: space_id,
|
17
|
-
access_token: ::Contentful::Scheduler.config[:spaces][space_id][:delivery_token]
|
18
|
-
)
|
19
|
-
|
20
|
-
clientManagement = ::Contentful::Management::Client.new(
|
21
|
-
token,
|
22
|
-
raise_errors: true,
|
23
|
-
application_name: 'contentful.scheduler',
|
24
|
-
application_version: Contentful::Scheduler::VERSION
|
11
|
+
contentfulClient = Contentful::Client.new(
|
12
|
+
space: space_id,
|
13
|
+
access_token: token
|
25
14
|
)
|
26
15
|
|
27
|
-
|
16
|
+
linkedEntries = contentfulClient.entries(links_to_entry: entry_id)
|
28
17
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
clientManagement.entries.find(space_id, entry_id).publish
|
18
|
+
client = ::Contentful::Management::Client.new(
|
19
|
+
token,
|
20
|
+
raise_errors: true,
|
21
|
+
application_name: 'contentful.scheduler',
|
22
|
+
application_version: Contentful::Scheduler::VERSION
|
23
|
+
)
|
24
|
+
linkedEntries.find(space_id, entry_id).publish
|
25
|
+
client.entries.find(space_id, entry_id).publish
|
38
26
|
end
|
39
|
-
|
40
27
|
end
|
41
28
|
end
|
42
29
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful-scheduler-custom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.111
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentful GmbH (David Litvak Bruno0
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: contentful
|
14
|
+
name: contentful-webhook-listener
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2
|
19
|
+
version: '0.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2
|
26
|
+
version: '0.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: contentful
|
28
|
+
name: contentful
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.9.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.9.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: contentful-management
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,7 +222,6 @@ files:
|
|
222
222
|
- lib/contentful/scheduler/tasks.rb
|
223
223
|
- lib/contentful/scheduler/tasks/publish.rb
|
224
224
|
- lib/contentful/scheduler/tasks/unpublish.rb
|
225
|
-
- lib/contentful/scheduler/taskshelper.rb
|
226
225
|
- lib/contentful/scheduler/version.rb
|
227
226
|
- spec/contentful/scheduler/auth_spec.rb
|
228
227
|
- spec/contentful/scheduler/controller_spec.rb
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Contentful
|
2
|
-
module Scheduler
|
3
|
-
module Taskshelper
|
4
|
-
def Taskshelper.extract_element_ids input_array
|
5
|
-
ids = []
|
6
|
-
input_array.each {|item| (ids << (Taskshelper.get_each_field item)).flatten!}
|
7
|
-
return ids.uniq
|
8
|
-
end
|
9
|
-
|
10
|
-
def Taskshelper.get_each_field item
|
11
|
-
ids = []
|
12
|
-
keys = item["fields"].keys
|
13
|
-
keys.each {|key| (ids << (Taskshelper.get_each_element key, item["fields"])).flatten!}
|
14
|
-
return ids
|
15
|
-
end
|
16
|
-
|
17
|
-
def Taskshelper.get_each_element key, item
|
18
|
-
ids = []
|
19
|
-
if item[key].is_a?(::Array)
|
20
|
-
item[key].each do |i|
|
21
|
-
(!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil
|
22
|
-
end
|
23
|
-
elsif item[key].is_a?(::Hash)
|
24
|
-
(!(item[key]["sys"]["linkType"].nil?) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
|
25
|
-
end
|
26
|
-
return ids
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|