philotic 0.1.2 → 0.1.3

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: 2cec3dcadcc2b8d955afbf4462918d366b685c80
4
- data.tar.gz: 7b9351048d2ce3c72c363c827f8c009e5b2a2811
3
+ metadata.gz: 39317c5b0270166a99673c49acea5ba95e6ec879
4
+ data.tar.gz: fd88d9409ae49657f4bfaab67b4ac76663900c31
5
5
  SHA512:
6
- metadata.gz: 94c7661e0ea7a7487ea8e9e69427a860deefa9f600384d3997ff388f914b1b7abcaf4b9a16646c1668fe8a33f421f090ac65cc795d05e2eb314bd5d0f38e44b7
7
- data.tar.gz: 94203a7b7f3dc1f6d73f4b5410eacce93d852e61dcf2e437281cd482bda67ab26043f302bf0257500f055bd342408694c6455226883f81aace30e0ed023da450
6
+ metadata.gz: a2d82f2ffdcc8f1f885ae3bd4919086d274dcde8dfc3c60e0d9fec9ea6e9f75bce9312b862812b130fce9cd3581d1886a6233f3b594b84bbf3c340c55ac8c014
7
+ data.tar.gz: d42cb0239b668e5a737f575fcb551d149f2bc2f6d2654158959b7377c226428e01e8b9f81c8b1425a6a54e347c16ddba9da022062edd095f8cf445770edb9820
@@ -5,9 +5,8 @@ $stdout.sync = true
5
5
  require 'philotic'
6
6
  require 'philotic/dummy_event'
7
7
 
8
- Philotic.logger = Logger.new('/dev/null')
8
+ Philotic.logger.level = Logger::WARN
9
9
 
10
- Philotic::Connection.connect!
11
10
  @event = Philotic::DummyEvent.new
12
11
 
13
12
  @event.philotic_firehose = true
@@ -16,6 +16,10 @@ module Philotic
16
16
 
17
17
  private
18
18
  def _publish(payload, message_metadata = {})
19
+ if config.disable_publish
20
+ Philotic.log_event_published(:warn, message_metadata, payload, 'attempted to publish a message when publishing is disabled.')
21
+ return false
22
+ end
19
23
  Philotic.connect!
20
24
  unless Philotic::Connection.connected?
21
25
  Philotic.log_event_published(:error, message_metadata, payload, 'unable to publish event, not connected to RabbitMQ')
@@ -25,8 +29,6 @@ module Philotic
25
29
 
26
30
  payload = normalize_payload_times(payload)
27
31
 
28
- return if config.disable_publish
29
-
30
32
  Philotic::Connection.exchange.publish(payload.to_json, message_metadata)
31
33
  Philotic.log_event_published(:debug, message_metadata, payload, 'published event')
32
34
  end
@@ -1,3 +1,3 @@
1
1
  module Philotic
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philotic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Keyes