contentful-scheduler-custom 1.5.4 → 1.5.5

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: fa465a2deabf1a667623e3d5c53819691426f8fb
4
- data.tar.gz: b5c0b957db793cbd0d63b17f631db350441ae787
3
+ metadata.gz: 488a4c42e0d829618efde8fdaf18953c81bafe63
4
+ data.tar.gz: 0c92afbe94d2639d6dd1e9e9618224cdfb1850db
5
5
  SHA512:
6
- metadata.gz: 61fbec12553f55075e76bb56cc3504d2da2101074d8425b7ef8767052ab0ebaed0153f89f4d3c4288a958fbc1099521e78004f23deb4fe50cd704b621b1bb7d1
7
- data.tar.gz: 6276006917017c3fbbcc0453d1e53da6934d1283a9f7a55077ab6a404a0b08122f4a5709c296b23bbb0bcd19af292243ff54a7f39f54ec77da7bd007cee805da
6
+ metadata.gz: bf1e2dc8b595901ee953edafd1e58ae965230791e32f0faf9a64aae8fd3451107c63aea1889923ace033381ab9458ca39e21b8ccb3bf88593d83c71e740c7043
7
+ data.tar.gz: 6ef9ca2783f080851ef7d122c0cee760f362cea97f4b384bb13407101a2695991fb6624510ab0c552b4286548bc4ab366d3890d3484682a2c74906eb1402d1c7
@@ -16,14 +16,14 @@ module Contentful
16
16
  def update_or_create(webhook)
17
17
  if publishable?(webhook)
18
18
  success = update_or_create_for_publish(webhook)
19
- log_event_success(webhook, success, 'publish', 'added to')
20
19
  updateContentBlocks(webhook, 'publish')
20
+ log_event_success(webhook, success, 'publish', 'added to')
21
21
  end
22
22
 
23
23
  if unpublishable?(webhook)
24
24
  success = update_or_create_for_unpublish(webhook)
25
- log_event_success(webhook, success, 'unpublish', 'added to')
26
25
  updateContentBlocks(webhook, 'unpublish')
26
+ log_event_success(webhook, success, 'unpublish', 'added to')
27
27
  end
28
28
 
29
29
  end
@@ -70,7 +70,7 @@ module Contentful
70
70
  ::Contentful::Scheduler.config[:management_token]
71
71
  )
72
72
 
73
- removeContentBlocks(webhook)
73
+ removeContentBlocks(webhook, 'publish')
74
74
 
75
75
  log_event_success(webhook, success, 'publish', 'removed from')
76
76
  end
@@ -86,9 +86,9 @@ module Contentful
86
86
  ::Contentful::Scheduler.config[:spaces][webhook.space_id][:management_token]
87
87
  )
88
88
  if success
89
- logger.info "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully added to queue"
89
+ logger.info "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully added to " + type + " queue"
90
90
  else
91
- logger.warn "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be added to queue"
91
+ logger.warn "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be added to " + type + " queue"
92
92
  end
93
93
  end
94
94
  end
@@ -102,19 +102,19 @@ module Contentful
102
102
  end
103
103
  end
104
104
 
105
- def removeContentBlocks(webhook)
105
+ def removeContentBlocks(webhook, type)
106
106
  if isContentBlockAvailable(webhook)
107
107
  webhook.fields['contentBlocks']['fi-FI'].each do |sys|
108
108
  success = Resque.remove_delayed(
109
- ::Contentful::Scheduler::Tasks::Publish,
109
+ getScheduleType(type),
110
110
  webhook.space_id,
111
111
  sys['sys']['id'],
112
112
  ::Contentful::Scheduler.config[:management_token]
113
113
  )
114
114
  if success
115
- logger.info "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully removed from queue"
115
+ logger.info "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully removed from " + type + " queue"
116
116
  else
117
- logger.warn "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be removed from queue"
117
+ logger.warn "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be removed from " + type + " queue"
118
118
  end
119
119
  end
120
120
  end
@@ -155,7 +155,7 @@ module Contentful
155
155
  ::Contentful::Scheduler.config[:management_token]
156
156
  )
157
157
 
158
- removeContentBlocks(webhook)
158
+ removeContentBlocks(webhook, 'unpublish')
159
159
 
160
160
  log_event_success(webhook, success, 'unpublish', 'removed from')
161
161
  end
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.5.4"
3
+ VERSION = "1.5.5"
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.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0