beetle 3.5.5 → 3.5.6

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: a0e823ee91e804e241eefc9057879a94c538c43c45f04af9c0e9491d6bc9e0b3
4
- data.tar.gz: b211a4cfb395af0a048431fa53f865a0b9b9a61478d5f0527cf8c794a4751273
3
+ metadata.gz: 05c783e8ae2cd39837e587954e252f6f8cd772756536cb51de030fdebddfa808
4
+ data.tar.gz: 63403a3e7c70a2840daedfbb41f067c260ac6ae0b34920334f0e26bb999b936b
5
5
  SHA512:
6
- metadata.gz: 244515a2a89649e6f09900b910bbe29c4d624b1750051136d26e7f49fcf825910b602f6714438e8a3a8bd9f9822af2a0955afbfe82cd46cb23acd393999346f8
7
- data.tar.gz: 3735d575d65abbf415e9bad4c74c2c84720144cd3147c6687061413eeaf296ea46a739bfdb731c62c4031bf751869acf4ef8ccc269146067c36a354f69fcb08c
6
+ metadata.gz: c43c533f5946971f25cbc664809842498f0e52b0404e0a23b772940707adf53288be74d7ca1f8f3cae1943a1d311a19f15b2fc4e3458b6347597367002e65af0
7
+ data.tar.gz: ae915f36ce7d9e78a10421b17bca59710b87964b3904db14ea1064dc6d87147d3e9c2faf6b552982d73ed227e88b4bd8b2d06d4a9d8335654d6008c95eade00b
@@ -46,7 +46,7 @@ end
46
46
 
47
47
  def system_notification_log_path
48
48
  log_path = tmp_path + "/system_notifications.log"
49
- `touch #{log_path}` unless File.exists?(log_path)
49
+ `touch #{log_path}` unless File.exist?(log_path)
50
50
  log_path
51
51
  end
52
52
 
@@ -131,11 +131,11 @@ module TestDaemons
131
131
  private
132
132
 
133
133
  def create_dir
134
- FileUtils.mkdir(dir) unless File.exists?(dir)
134
+ FileUtils.mkdir(dir) unless File.exist?(dir)
135
135
  end
136
136
 
137
137
  def remove_dir
138
- FileUtils.rm_r(dir) if File.exists?(dir)
138
+ FileUtils.rm_r(dir) if File.exist?(dir)
139
139
  end
140
140
 
141
141
  def create_config
@@ -145,11 +145,11 @@ module TestDaemons
145
145
  end
146
146
 
147
147
  def remove_config
148
- FileUtils.rm(config_filename) if File.exists?(config_filename)
148
+ FileUtils.rm(config_filename) if File.exist?(config_filename)
149
149
  end
150
150
 
151
151
  def remove_pid_file
152
- FileUtils.rm(pid_file) if File.exists?(pid_file)
152
+ FileUtils.rm(pid_file) if File.exist?(pid_file)
153
153
  end
154
154
 
155
155
  def tmp_path
@@ -1,3 +1,3 @@
1
1
  module Beetle
2
- VERSION = "3.5.5"
2
+ VERSION = "3.5.6"
3
3
  end
data/lib/beetle.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  $:.unshift(File.expand_path('..', __FILE__))
2
2
  require 'bunny' # which bunny picks up
3
3
  require 'qrack/errors' # needed by the publisher
4
+
5
+ if Gem::Version.new(Bunny::VERSION) <= Gem::Version.new("0.7.12") && !defined?(::Fixnum)
6
+ require 'qrack/transport/buffer09'
7
+ Qrack::Transport09::Buffer.class_eval "Fixnum = Integer"
8
+ end
9
+
4
10
  begin
5
11
  require 'redis/connection/hiredis' # require *before* redis as specified in the redis-rb gem docs
6
12
  require 'redis'
@@ -0,0 +1,32 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ class BunnyBehaviorTest < Minitest::Test
4
+ test "publishing fixnums and hashes works in amqp headers" do
5
+ client = Beetle::Client.new
6
+ client.register_queue(:test)
7
+ client.register_message(:test)
8
+
9
+ # purge the test queue
10
+ client.purge(:test)
11
+
12
+ # empty the dedup store
13
+ client.deduplication_store.flushdb
14
+
15
+ # register our handler to the message, check out the message.rb for more stuff you can get from the message object
16
+ message = nil
17
+ client.register_handler(:test) {|msg| message = msg; client.stop_listening }
18
+
19
+ # publish our message (NOTE: empty message bodies don't work, most likely due to bugs in bunny/amqp)
20
+ published = client.publish(:test, 'bam', headers: { foo: 1, table: {bar: "baz"}})
21
+
22
+ # start listening
23
+ client.listen
24
+ client.stop_publishing
25
+
26
+ assert_equal 1, published
27
+ assert_equal "bam", message.data
28
+ headers = message.header.attributes[:headers]
29
+ assert_equal 1, headers["foo"]
30
+ assert_equal({"bar" => "baz"}, headers["table"])
31
+ end
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beetle
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.5
4
+ version: 3.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2022-09-02 00:00:00.000000000 Z
15
+ date: 2023-03-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bunny
@@ -407,6 +407,7 @@ files:
407
407
  - test/beetle/amqp_gem_behavior_test.rb
408
408
  - test/beetle/base_test.rb
409
409
  - test/beetle/beetle_test.rb
410
+ - test/beetle/bunny_behavior_test.rb
410
411
  - test/beetle/client_test.rb
411
412
  - test/beetle/configuration_test.rb
412
413
  - test/beetle/deduplication_store_test.rb
@@ -440,7 +441,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
440
441
  - !ruby/object:Gem::Version
441
442
  version: 1.3.7
442
443
  requirements: []
443
- rubygems_version: 3.3.19
444
+ rubygems_version: 3.4.6
444
445
  signing_key:
445
446
  specification_version: 3
446
447
  summary: High Availability AMQP Messaging with Redundant Queues
@@ -448,6 +449,7 @@ test_files:
448
449
  - test/beetle/amqp_gem_behavior_test.rb
449
450
  - test/beetle/base_test.rb
450
451
  - test/beetle/beetle_test.rb
452
+ - test/beetle/bunny_behavior_test.rb
451
453
  - test/beetle/client_test.rb
452
454
  - test/beetle/configuration_test.rb
453
455
  - test/beetle/deduplication_store_test.rb