nuntius 1.3.20 → 1.4.0

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
  SHA256:
3
- metadata.gz: 4c35384ba46c7a00cccf82ae49b6ecf09e5e6c2439196ba5cd03d6d508a4ff1d
4
- data.tar.gz: bf0e4bde69a856f82f37c205d15f3685d4da3eb612cd2eaf582642bdd388574a
3
+ metadata.gz: 96231ee66f145c33c7c1fea7669be34a28d03c4c8f802cee010c984ad97f30c7
4
+ data.tar.gz: 98c827211fc8a8082710352838744ecb7b646ef4083493eb7078059b1627471b
5
5
  SHA512:
6
- metadata.gz: ddc8ce1306965ac2306ca8ab1d7e258478868d669b34b9eb997cb6dee6f747f0e06ac5149b51afb02dcdc3bb3f50eecefe0f3dfe035e771089ade69241537098
7
- data.tar.gz: f64fc4ad0d78a90f8c1cac8fb99106322af707387d10d0b51af82d1879a0ef77a3fb4f7c46414c4a9551f77cb473e1cb3e04d8f8b3d26ecf1342b2ad019f0e70
6
+ metadata.gz: d3c2ba2b4663c73fd4ac849b0a94878646b1f32c743be1c7f1db8f9529934920497abb54345f7d35b56f7cd682ecbc710944f3bd89c9a7444f7878b7967b79d4
7
+ data.tar.gz: d54a2dd92af1f92cc40886c4be3bdfea123bdcb9f451abca15b919258f010b2363bc404b3f6f0a7c1f78bf1fb417dc65f0328fca12d98e7c38e9f381a44c963d
data/README.md CHANGED
@@ -64,6 +64,7 @@ class CarMessenger < Nuntius::BaseMessenger
64
64
  pdf = ApplicationController.renderer.new(http_host: object.account.hostname, https: true).render(template: "commercial_invoice/show", formats: [:pdf], assigns: {order: object})
65
65
 
66
66
  attachments << {content: StringIO.new(pdf), content_type: "application/pdf", filename: "commercial_invoice.pdf"}
67
+ # Return false here if you don't want the message to be sent
67
68
  end
68
69
  end
69
70
  ```
@@ -9,7 +9,9 @@ module Nuntius
9
9
  messenger = Nuntius::BaseMessenger.messenger_for_obj(obj).new(obj, event, params)
10
10
  return unless messenger.is_a?(Nuntius::CustomMessenger) || messenger.respond_to?(event.to_sym)
11
11
 
12
- messenger.call
12
+ result = messenger.call
13
+ return if result == false
14
+
13
15
  templates = messenger.templates
14
16
  messenger.dispatch(templates) if templates.present?
15
17
  end
@@ -22,9 +22,11 @@ module Nuntius
22
22
  # Calls the event method on the messenger
23
23
  def call
24
24
  select_templates
25
+ result = nil
25
26
  run_callbacks(:action) do
26
- send(@event.to_sym, @object, @params) if respond_to?(@event.to_sym)
27
+ result = send(@event.to_sym, @object, @params) if respond_to?(@event.to_sym)
27
28
  end
29
+ result
28
30
  end
29
31
 
30
32
  # Turns the templates in messages, and dispatches the messages to transports
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuntius
4
- VERSION = "1.3.20"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nuntius
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.20
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt