bug_bunny 0.2.3 → 0.2.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
  SHA256:
3
- metadata.gz: 44a4635e06b113a429bf55f1d1d9d26ecd106fdfe9bd91d2feb975352f5905a1
4
- data.tar.gz: 1006a577430270652be5f21a8215dea9777f423b85fdc2f699c1903560ea2864
3
+ metadata.gz: 0f841d7999ff2bf99c3e9d019b5ccfdb7ba0d6263d48adea655175cdc3b39569
4
+ data.tar.gz: 2729e4af16616823950a1aaf5e49206c77c95567049c3f5dd956b347ef90b7ab
5
5
  SHA512:
6
- metadata.gz: 84699963ef67a52f7c50b0e934818d17ee6fb0e177594d99d4f11fd522e88475cc3bbf229285011e9b5e6e6d92b9225fe1700d796b3778a66eb5b9d7f15badd1
7
- data.tar.gz: 28e10b78f4def1df46779b0abac6624ee1ead627d0c992c2b3eec97cb770d8344bcce4568eb7e4f5592995fb5970fb1995606523c37a70cfd8e9992680baa590
6
+ metadata.gz: fe5a26882d6515bb1731cc3aa3f38446c7cdbc09698cb9091cc0a8b4125ec2939e41d05cd27b4293f74f00405c027a98a01fc3c7db8c9737b762fee97a4653c2
7
+ data.tar.gz: 1653165f74ef1e4e22e0bb75500a6aa5d8f17cc2879e2d08945f43366072f552fb8babe579c28d393f0f94e9db774e7b65399178893fd86ce5d878fc35a0cace
@@ -21,7 +21,7 @@ module BugBunny
21
21
 
22
22
  def initialize(attrs = {})
23
23
  @logger = Logger.new('./log/bug_bunny.log', 'monthly')
24
- @communication_response = ::BugBunny::Response.new status: false
24
+ @communication_response = ::BugBunny::Message.new(status: :error)
25
25
  @time_to_wait = 2
26
26
  create_adapter_with_rabbit
27
27
  end
@@ -29,7 +29,7 @@ module BugBunny
29
29
  def publish!(message, publish_queue, opts = {})
30
30
  Timeout::timeout(TIMEOUT) do
31
31
  if opts[:check_consumers_count] && publish_queue.check_consumers.zero?
32
- self.communication_response = ::BugBunny::Response.new(status: false, response: CONSUMER_COUNT_ZERO)
32
+ self.communication_response = ::BugBunny::Message.new(status: :error, body: CONSUMER_COUNT_ZERO)
33
33
  return
34
34
  end
35
35
 
@@ -51,16 +51,16 @@ module BugBunny
51
51
  rabbit.exchange.publish(message.to_json, publish_opts)
52
52
  rabbit.channel.wait_for_confirms if rabbit.confirm_select
53
53
 
54
- self.communication_response = ::BugBunny::Response.new(status: true)
54
+ self.communication_response = ::BugBunny::Message.new(status: true)
55
55
  end
56
56
  rescue Timeout::Error => e
57
57
  logger.error(e)
58
58
  close_connection!
59
- self.communication_response = ::BugBunny::Response.new(status: false, response: PUBLISH_TIMEOUT, exception: e)
59
+ self.communication_response = ::BugBunny::Message.new(status: :error, body: PUBLISH_TIMEOUT, exception: e)
60
60
  rescue StandardError => e
61
61
  logger.error(e)
62
62
  close_connection!
63
- self.communication_response = ::BugBunny::Response.new(status: false, response: BOMBA, exception: e)
63
+ self.communication_response = ::BugBunny::Message.new(status: :error, body: BOMBA, exception: e)
64
64
  end
65
65
 
66
66
  def consume!(queue, thread: false, manual_ack: true, exclusive: false, block: true, opts: {})
@@ -124,7 +124,7 @@ module BugBunny
124
124
  end
125
125
 
126
126
  self.service_message = message
127
- self.communication_response = ::BugBunny::Response.new(status: true)
127
+ self.communication_response = ::BugBunny::Message.new(status: :success)
128
128
  rescue ::SystemExit => e # Ensure exit code
129
129
  raise e
130
130
  rescue => e
@@ -134,7 +134,7 @@ module BugBunny
134
134
  close_connection!
135
135
 
136
136
  # Session.clean!
137
- self.communication_response = ::BugBunny::Response.new(status: false, response: BOMBA, exception: e)
137
+ self.communication_response = ::BugBunny::Message.new(status: :error, body: BOMBA, exception: e)
138
138
  end
139
139
 
140
140
  if thread # sync consumer flag :D
@@ -190,12 +190,12 @@ module BugBunny
190
190
  logger.debug("Rabbit Identifier: #{rabbit.try(:identifier)}")
191
191
  logger.error(e)
192
192
  close_connection!
193
- ::BugBunny::Response.new(status: false, response: CONSUMER_TIMEOUT, exception: e)
193
+ ::BugBunny::Message.new(status: :error, body: CONSUMER_TIMEOUT, exception: e)
194
194
  rescue StandardError => e
195
195
  logger.debug("Rabbit Identifier: #{rabbit.try(:identifier)}")
196
196
  logger.error(e)
197
197
  close_connection!
198
- ::BugBunny::Response.new(status: false, response: BOMBA, exception: e)
198
+ ::BugBunny::Message.new(status: :error, body: BOMBA, exception: e)
199
199
  end
200
200
 
201
201
  def publish_and_consume!(publish_message, sync_queue, opts={})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BugBunny
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bug_bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - gabix
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-28 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -68,7 +68,7 @@ metadata:
68
68
  homepage_uri: https://github.com/gedera/bug_bunny
69
69
  source_code_uri: https://github.com/gedera/bug_bunny
70
70
  changelog_uri: https://github.com/gedera/bug_bunny/blob/main/CHANGELOG.md
71
- post_install_message:
71
+ post_install_message:
72
72
  rdoc_options: []
73
73
  require_paths:
74
74
  - lib
@@ -83,8 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.5.11
87
- signing_key:
86
+ rubygems_version: 3.4.1
87
+ signing_key:
88
88
  specification_version: 4
89
89
  summary: Gem for sync and async comunication via rabbit bunny.
90
90
  test_files: []