contentful-scheduler-custom 1.6 → 1.6.7.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -4
- data/contentful-scheduler.gemspec +1 -0
- data/lib/contentful/scheduler/tasks/publish.rb +19 -0
- data/lib/contentful/scheduler/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7227e3918e6c24e292438c33a20d75aa2ab288562128fffe21bfc5c07cc2fe49
|
4
|
+
data.tar.gz: 0ceef758c5c8dfbce9ab2f088b6d47e1ca8842f6550d5cd5c4da76eee479a233
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 107b16e7b86c77f2e82d6e697fb9c944464080c2921c4523d26ab42b6892f476f580f8cb1ae2874bd47cdff93f4167aad84db24ee4a913b1d87b4e9ffbf47f1f
|
7
|
+
data.tar.gz: 6bde47f6e48eefb070f5d0184e33cccd47ddc5db5130c7ae2f4579d9a34d8fbf8efbb6be8d8c71d6f9043c7e46a5f31ebe6f9170da6275173515c87eacbdeb6c
|
data/README.md
CHANGED
@@ -95,11 +95,9 @@ config = {
|
|
95
95
|
publish_field: 'publishDate', # It specifies the field ID for your Publish Date in your Content Type
|
96
96
|
auth: { # This is optional
|
97
97
|
# ... content in this section will be explained in a separate section ...
|
98
|
-
|
98
|
+
},
|
99
99
|
management_token: 'YOUR_TOKEN'
|
100
100
|
},
|
101
|
-
management_token: 'YOUR_TOKEN'
|
102
|
-
},
|
103
101
|
'YOUR_SPACE_ID' => {
|
104
102
|
publish_field: 'publishDate', # It specifies the field ID for your Publish Date in your Content Type
|
105
103
|
unpublish_field: 'unpublishDate', # Optional - It specifies the field ID for your Unpublish Date in your Content Type
|
@@ -116,7 +114,7 @@ https://github.devcloud.elisa.fi/contentful-cms/scheduler/pull/2/conflict?name=R
|
|
116
114
|
}
|
117
115
|
management_token: 'YOUR_TOKEN'
|
118
116
|
}
|
119
|
-
}
|
117
|
+
}
|
120
118
|
}
|
121
119
|
|
122
120
|
namespace :contentful do
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_runtime_dependency "contentful-webhook-listener", "~> 0.2"
|
23
23
|
spec.add_runtime_dependency "contentful-management", "~> 1.8"
|
24
|
+
spec.add_runtime_dependency "contentful", "~> 2.11.1"
|
24
25
|
spec.add_runtime_dependency "resque", "~> 1.27.4"
|
25
26
|
spec.add_runtime_dependency "resque-scheduler", "~> 4.3.1"
|
26
27
|
spec.add_runtime_dependency "redis", "~> 4.0.1"
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'contentful/management'
|
2
|
+
require 'contentful'
|
2
3
|
|
3
4
|
module Contentful
|
4
5
|
module Scheduler
|
@@ -6,15 +7,33 @@ module Contentful
|
|
6
7
|
class Publish
|
7
8
|
@queue = :publish
|
8
9
|
|
10
|
+
attr_reader :config, :logger
|
11
|
+
|
12
|
+
def self.instance(logger = ::Contentful::Webhook::Listener::Support::NullLogger.new)
|
13
|
+
@@instance ||= new(logger)
|
14
|
+
end
|
15
|
+
|
9
16
|
def self.perform(space_id, entry_id, token)
|
17
|
+
client1 = Contentful::Client.new(
|
18
|
+
space: space_id,
|
19
|
+
access_token: token,
|
20
|
+
dynamic_entries: :auto # Enables Content Type caching.
|
21
|
+
)
|
22
|
+
entry_with_specific_relationship = client1.entries('fields.305TcOWowok6cYgoCIm8Ya.sys.id' => entry_id)
|
10
23
|
client = ::Contentful::Management::Client.new(
|
11
24
|
token,
|
12
25
|
raise_errors: true,
|
13
26
|
application_name: 'contentful.scheduler',
|
14
27
|
application_version: Contentful::Scheduler::VERSION
|
15
28
|
)
|
29
|
+
allContentType = client.content_types.all.items
|
30
|
+
logger.info "All content types available: #{allContentType} contenttype specific to entery are #{entry_with_specific_relationship.items}"
|
16
31
|
client.entries.find(space_id, entry_id).publish
|
17
32
|
end
|
33
|
+
def initialize(logger)
|
34
|
+
@config = ::Contentful::Scheduler.config
|
35
|
+
@logger = logger
|
36
|
+
end
|
18
37
|
end
|
19
38
|
end
|
20
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful-scheduler-custom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.6.7.8
|
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: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: contentful-webhook-listener
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.8'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: contentful
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.11.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.11.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: resque
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -236,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
250
|
version: '0'
|
237
251
|
requirements: []
|
238
252
|
rubyforge_project:
|
239
|
-
rubygems_version: 2.
|
253
|
+
rubygems_version: 2.7.7
|
240
254
|
signing_key:
|
241
255
|
specification_version: 4
|
242
256
|
summary: Customizable Scheduler for Contentful Entries.
|