nuntius 1.3.12 → 1.3.13

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: 905f2e66b5e0ba5115194a596cdabd4a789bd562056e8cd74c0682a75ca03a16
4
- data.tar.gz: b8e7f0d4f02a7dcd21ca5478fbd16f81e0e7dee5a5fe941c0c701eeadbc882b2
3
+ metadata.gz: 584da021b4c681fe277c840dcd4e99dfa2731c3fe4c710dcdfe62734a4c712f4
4
+ data.tar.gz: 299d1b4f70ae9505b1ec9b78f750020d4cc9bb0319074b8b1cd0033710a27a9c
5
5
  SHA512:
6
- metadata.gz: aa8589b5ecaea6bac7334e911afe7fa24a0a09ecf2d499178ef1e7dec6393f3d6ecbac898e0c52d669a448e68f99d8d40072b6081d64b4bfe527ee13bca80ad6
7
- data.tar.gz: a89f739a86358e2df8203a1a07201e807656b811adc5d59aa25b1c36697cf6e5008c081bc821b6735d64dc8d3b9f3a0a1539581a4aa629e64a3bee07d2ea117b
6
+ metadata.gz: 5120c360d5250177e4b4eb891901200976caddd11f09f8ad6512f345c7f2e8dc0d47cbf77d9e83297593886b8024f9f8de1b84b484af21b50bb0b6ab92537a11
7
+ data.tar.gz: ae5eb23e49a3548ecdd528495f9610232afdf5bc0ab7f571aa391cdc588c514f4de6e96e661e3c40a484a7687cc53edd5e05649d98ada49edfd46c1469d3e4ef
@@ -4,10 +4,13 @@ module Nuntius
4
4
  class TimebasedEventsJob < ApplicationJob
5
5
  def perform
6
6
  Nuntius::Template.where.not(interval: nil).each do |template|
7
- messenger = Nuntius::BaseMessenger.messenger_for_class(template.klass)
7
+ messenger_class = Nuntius::BaseMessenger.messenger_for_class(template.klass)
8
8
 
9
- messenger.timebased_scope_for(template).each do |object|
10
- Nuntius.event(template.event, object)
9
+ messenger_class.timebased_scope_for(template).each do |object|
10
+ messenger = messenger_class.new(object, template.event)
11
+ next unless messenger.is_a?(Nuntius::CustomMessenger) || messenger.respond_to?(template.event.to_sym)
12
+
13
+ messenger.dispatch([template])
11
14
  end
12
15
  end
13
16
  end
@@ -24,8 +24,8 @@ module Nuntius
24
24
  # First refresh check is after 5 seconds
25
25
  if message.delivered_or_blocked?
26
26
  message.cleanup!
27
- else
28
- Nuntius::TransportRefreshJob.set(wait: 5).perform_later(provider_name, message) unless Rails.env.development?
27
+ elsif !Rails.env.development? && !Rails.env.test?
28
+ Nuntius::TransportRefreshJob.set(wait: 5).perform_later(provider_name, message)
29
29
  end
30
30
  end
31
31
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "pry"
4
3
  module Nuntius
5
4
  # Stores individual messages to individual recipients
6
5
  #
@@ -15,7 +15,7 @@ module Nuntius
15
15
  providers_for_priority.each do |hash|
16
16
  message.update(provider: hash[:provider].to_s) if message.provider.blank?
17
17
 
18
- Nuntius::TransportDeliveryJob.set(wait: !Rails.env.development? && wait_time).perform_later(hash[:provider].to_s, message)
18
+ Nuntius::TransportDeliveryJob.set(wait: !Rails.env.development? && !Rails.env.test? && wait_time).perform_later(hash[:provider].to_s, message)
19
19
  time_out += hash[:timeout].seconds if hash[:timeout].positive?
20
20
  end
21
21
  wait_time += time_out
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuntius
4
- VERSION = "1.3.12"
4
+ VERSION = "1.3.13"
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nuntius
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.12
4
+ version: 1.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-10 00:00:00.000000000 Z
11
+ date: 2024-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apnotic
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.7.0
19
+ version: '1.7'
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: 1.7.0
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: auxilium
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.56'
47
+ version: '1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.56'
54
+ version: '1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: fcm
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +220,20 @@ dependencies:
220
220
  - - ">="
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: ostruct
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
223
237
  - !ruby/object:Gem::Dependency
224
238
  name: parse-cron
225
239
  requirement: !ruby/object:Gem::Requirement
@@ -374,34 +388,20 @@ dependencies:
374
388
  - - "~>"
375
389
  - !ruby/object:Gem::Version
376
390
  version: '3.6'
377
- - !ruby/object:Gem::Dependency
378
- name: pry
379
- requirement: !ruby/object:Gem::Requirement
380
- requirements:
381
- - - "~>"
382
- - !ruby/object:Gem::Version
383
- version: '0'
384
- type: :development
385
- prerelease: false
386
- version_requirements: !ruby/object:Gem::Requirement
387
- requirements:
388
- - - "~>"
389
- - !ruby/object:Gem::Version
390
- version: '0'
391
391
  - !ruby/object:Gem::Dependency
392
392
  name: debug
393
393
  requirement: !ruby/object:Gem::Requirement
394
394
  requirements:
395
395
  - - "~>"
396
396
  - !ruby/object:Gem::Version
397
- version: '0'
397
+ version: '1'
398
398
  type: :development
399
399
  prerelease: false
400
400
  version_requirements: !ruby/object:Gem::Requirement
401
401
  requirements:
402
402
  - - "~>"
403
403
  - !ruby/object:Gem::Version
404
- version: '0'
404
+ version: '1'
405
405
  - !ruby/object:Gem::Dependency
406
406
  name: rubocop
407
407
  requirement: !ruby/object:Gem::Requirement