contentful-scheduler-custom 1.5.3 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0b82b5e275d4c0dae01a44780318417ab6f87e3
4
- data.tar.gz: 42719ffbdc3ccf8d5575b48142a715f4bb8c13d7
3
+ metadata.gz: fa465a2deabf1a667623e3d5c53819691426f8fb
4
+ data.tar.gz: b5c0b957db793cbd0d63b17f631db350441ae787
5
5
  SHA512:
6
- metadata.gz: 9a05d4921b687ca48b7e4cb52201756c227d736fa27bcc152b5f01b7eb7ed15a6da47df2b0ffe51eeccf52d9515bd1ae14fa4fc066f751cf7067829f67f00398
7
- data.tar.gz: ad89cfde974e0ade192c67809a281cb59f03feee3b024db99155ad07dde51e178d54211f204cfcd3ae40952f4dac3abf5682a0a76722355f2211b9023ddd5182
6
+ metadata.gz: 61fbec12553f55075e76bb56cc3504d2da2101074d8425b7ef8767052ab0ebaed0153f89f4d3c4288a958fbc1099521e78004f23deb4fe50cd704b621b1bb7d1
7
+ data.tar.gz: 6276006917017c3fbbcc0453d1e53da6934d1283a9f7a55077ab6a404a0b08122f4a5709c296b23bbb0bcd19af292243ff54a7f39f54ec77da7bd007cee805da
@@ -17,14 +17,15 @@ module Contentful
17
17
  if publishable?(webhook)
18
18
  success = update_or_create_for_publish(webhook)
19
19
  log_event_success(webhook, success, 'publish', 'added to')
20
+ updateContentBlocks(webhook, 'publish')
20
21
  end
21
22
 
22
23
  if unpublishable?(webhook)
23
24
  success = update_or_create_for_unpublish(webhook)
24
25
  log_event_success(webhook, success, 'unpublish', 'added to')
26
+ updateContentBlocks(webhook, 'unpublish')
25
27
  end
26
28
 
27
- updateContentBlocks(webhook)
28
29
  end
29
30
 
30
31
  def update_or_create_for_publish(webhook)
@@ -74,12 +75,12 @@ module Contentful
74
75
  log_event_success(webhook, success, 'publish', 'removed from')
75
76
  end
76
77
 
77
- def updateContentBlocks(webhook)
78
+ def updateContentBlocks(webhook, type)
78
79
  if isContentBlockAvailable(webhook)
79
80
  webhook.fields['contentBlocks']['fi-FI'].each do |sys|
80
81
  success = Resque.enqueue_at(
81
82
  publish_date(webhook),
82
- ::Contentful::Scheduler::Tasks::Publish,
83
+ getScheduleType(type),
83
84
  webhook.space_id,
84
85
  sys['sys']['id'],
85
86
  ::Contentful::Scheduler.config[:spaces][webhook.space_id][:management_token]
@@ -93,6 +94,14 @@ module Contentful
93
94
  end
94
95
  end
95
96
 
97
+ def getScheduleType(type)
98
+ if type == 'unpublish'
99
+ return ::Contentful::Scheduler::Tasks::Unpublish
100
+ else
101
+ return ::Contentful::Scheduler::Tasks::Publish
102
+ end
103
+ end
104
+
96
105
  def removeContentBlocks(webhook)
97
106
  if isContentBlockAvailable(webhook)
98
107
  webhook.fields['contentBlocks']['fi-FI'].each do |sys|
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.5.3"
3
+ VERSION = "1.5.4"
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.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0