bunny 0.7.11 → 0.7.13

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
- SHA1:
3
- metadata.gz: 730835b43c635e1c2bed1e7bc9b45a729c27a4f2
4
- data.tar.gz: 66fa00bed722634a61b0344783c67ab0f448fc41
2
+ SHA256:
3
+ metadata.gz: 57852c2972d82a8c8a9742026c86d08bf3c7eb62486720fdff700bf86bbd1a6d
4
+ data.tar.gz: 64698a92d4a10ef741d965d5688bb7c5ca8a719ef4372616f59b35e6625afd6d
5
5
  SHA512:
6
- metadata.gz: 5313afeff12e6166479615e17779bfb08962a9d71c1d0e1f13a6ff552f325232954ed31ef37f10c8c7f93d462cc7ec86b7bba7d113b61410b954f155dbba37e2
7
- data.tar.gz: 1bccb496d6204b99d707f684b8d068bb4f277e2dd887e0b6355cf90d60e6bdd8900bfc2aaf5fc036e2896a44acbc208601554b5e1898c6a0a098db66b8072091
6
+ metadata.gz: af605621674f7d907ae4b8ce550dd178d95b9337e53cd7d4b36285b2060ce1014ee923357f80e74e0986a337388e131d20f7b1702788a4c2bbd38efb0b0303d6
7
+ data.tar.gz: 96378e392f16a5429fd690b1f9ce4c6c996c1f573a77bc0cbedce701279cb80969bf049219970a6503ee98dcafc9c67dc584bac8c8a2f59e9e5c166b2aee155b
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  *.rbc
5
5
  *.gem
6
6
  /doc/
7
+ /debug/
7
8
  .yardoc
8
9
  .rvmrc
9
10
  Gemfile.lock
data/Gemfile CHANGED
@@ -35,7 +35,7 @@ group :development do
35
35
  end
36
36
 
37
37
  group :test do
38
- gem "rspec", "~> 3.6.0"
38
+ gem "rspec"
39
39
  end
40
40
 
41
41
  gemspec
data/bunny.gemspec CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "http://github.com/ruby-amqp/bunny"
11
11
  s.summary = "Synchronous Ruby AMQP 0.9.1 client"
12
12
  s.description = "A synchronous Ruby AMQP client that enables interaction with AMQP-compliant brokers."
13
+ s.license = "MIT"
13
14
 
14
15
  # Sorted alphabetically.
15
16
  s.authors = [
@@ -28,10 +29,9 @@ Gem::Specification.new do |s|
28
29
  map { |mail| Base64.decode64(mail) }
29
30
 
30
31
  # Files.
31
- s.has_rdoc = true
32
32
  s.extra_rdoc_files = ["README.textile"]
33
33
  s.rdoc_options = ["--main", "README.rdoc"]
34
- s.files = `git ls-files`.split("\n")
34
+ s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^bin/ci/}) }
35
35
  s.test_files = `git ls-files -- spec/*`.split("\n")
36
36
  s.require_paths = ["lib"]
37
37
 
@@ -40,7 +40,4 @@ Gem::Specification.new do |s|
40
40
  s.post_install_message = CHANGELOG.new.version_changes
41
41
  rescue LoadError
42
42
  end
43
-
44
- # RubyForge
45
- s.rubyforge_project = "bunny-amqp"
46
43
  end
data/lib/bunny/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Bunny
4
- VERSION = "0.7.11"
4
+ VERSION = "0.7.13"
5
5
  end
data/lib/qrack/client.rb CHANGED
@@ -52,7 +52,7 @@ module Qrack
52
52
  @verify_ssl = opts[:verify_ssl].nil? || opts[:verify_ssl]
53
53
  @status = :not_connected
54
54
  @frame_max = opts[:frame_max] || 131072
55
- @channel_max = opts[:channel_max] || 0
55
+ @channel_max = opts[:channel_max] || 2047
56
56
  @heartbeat = opts[:heartbeat] || 0
57
57
  @connect_timeout = opts[:connect_timeout] || CONNECT_TIMEOUT
58
58
  @read_write_timeout = opts[:socket_timeout]
@@ -79,7 +79,7 @@ module Qrack
79
79
 
80
80
  # Close all active channels
81
81
  channels.each do |c|
82
- Bunny::Timer::timeout(@disconnect_timeout) { c.close } if c.open?
82
+ Bunny::Timer::timeout(@read_write_timeout) { c.close } if c.open?
83
83
  end
84
84
 
85
85
  # Close connection to AMQP server
@@ -194,7 +194,7 @@ module Qrack
194
194
  when String
195
195
  table.write(:octet, 83) # 'S'
196
196
  table.write(:longstr, value.to_s)
197
- when Fixnum
197
+ when Integer
198
198
  table.write(:octet, 73) # 'I'
199
199
  table.write(:long, value)
200
200
  when Float
@@ -194,7 +194,7 @@ module Qrack
194
194
  when String
195
195
  table.write(:octet, 83) # 'S'
196
196
  table.write(:longstr, value.to_s)
197
- when Fixnum
197
+ when Integer
198
198
  table.write(:octet, 73) # 'I'
199
199
  table.write(:long, value)
200
200
  when Float
@@ -216,6 +216,8 @@ module Qrack
216
216
  when FalseClass
217
217
  table.write(:octet, 116) # 't'
218
218
  table.write(:octet, 0)
219
+ else
220
+ raise Qrack::InvalidTypeError, "Cannot write table field for the type of #{value}"
219
221
  end
220
222
 
221
223
  table
@@ -8,7 +8,7 @@
8
8
  # If this is not the case, please change the 'Bunny.new' call below to include
9
9
  # the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
10
10
 
11
- require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib bunny]))
11
+ require_relative "../spec_helper"
12
12
 
13
13
  describe Bunny do
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # connection_spec.rb
4
4
 
5
- require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib bunny]))
5
+ require_relative "../spec_helper"
6
6
 
7
7
  describe Bunny do
8
8
 
@@ -8,7 +8,7 @@
8
8
  # If this is not the case, please change the 'Bunny.new' call below to include
9
9
  # the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
10
10
 
11
- require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib bunny]))
11
+ require_relative "../spec_helper"
12
12
 
13
13
  describe 'Exchange' do
14
14
 
@@ -135,6 +135,11 @@ describe 'Exchange' do
135
135
  opts.should == {:key => 'a', :persistent => true}
136
136
  end
137
137
 
138
+ it "should be able to publish a message with headers containing integer values" do
139
+ exch = @b.exchange('direct_exchange')
140
+ exch.publish('This is a published message', :headers => {:a => 1})
141
+ end
142
+
138
143
  it "should be able to return an undeliverable message" do
139
144
  exch = @b.exchange('return_exch')
140
145
  exch.publish('This message should be undeliverable', :mandatory => true)
@@ -8,12 +8,12 @@
8
8
  # If this is not the case, please change the 'Bunny.new' call below to include
9
9
  # the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
10
10
 
11
- require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib bunny]))
11
+ require_relative "../spec_helper"
12
12
 
13
13
  describe 'Queue' do
14
14
 
15
15
  def expect_deprecation_warning_for_publishing_on_queue(q, n=1)
16
- Bunny.should_receive(:deprecation_warning).with("Qrack::Queue#publish", "0.8", anything).exactly(n).times
16
+ expect(Bunny).to receive(:deprecation_warning).with("Qrack::Queue#publish", "0.8", anything).exactly(n).times
17
17
  end
18
18
 
19
19
  def message_count(queue, sleep_time = 0.1)
@@ -6,7 +6,7 @@
6
6
  # If this is not the case, please change the 'Bunny.new' call below to include
7
7
  # the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
8
8
 
9
- require "bunny"
9
+ require_relative "../spec_helper"
10
10
 
11
11
  describe Bunny do
12
12
  context "AMQP URL parsing" do
@@ -8,7 +8,7 @@
8
8
  # If this is not the case, please change the 'Bunny.new' call below to include
9
9
  # the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
10
10
 
11
- require "bunny"
11
+ require_relative "../spec_helper"
12
12
 
13
13
  describe Bunny do
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # connection_spec.rb
4
4
 
5
- require "bunny"
5
+ require_relative "../spec_helper"
6
6
 
7
7
  describe Bunny do
8
8
 
@@ -8,7 +8,7 @@
8
8
  # If this is not the case, please change the 'Bunny.new' call below to include
9
9
  # the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
10
10
 
11
- require "bunny"
11
+ require_relative "../spec_helper"
12
12
 
13
13
  describe 'Exchange' do
14
14
 
@@ -128,6 +128,11 @@ describe 'Exchange' do
128
128
  exch.publish('This is a published message')
129
129
  end
130
130
 
131
+ it "should be able to publish a message with headers containing integer values" do
132
+ exch = @b.exchange('direct_exchange')
133
+ exch.publish('This is a published message', :headers => {:a => 1})
134
+ end
135
+
131
136
  it "should not modify the passed options hash when publishing a message" do
132
137
  exch = @b.exchange('direct_exchange')
133
138
  opts = {:key => 'a', :persistent => true}
@@ -8,7 +8,7 @@
8
8
  # If this is not the case, please change the 'Bunny.new' call below to include
9
9
  # the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
10
10
 
11
- require "bunny"
11
+ require_relative "../spec_helper"
12
12
 
13
13
  describe 'Queue' do
14
14
 
@@ -0,0 +1,8 @@
1
+ require "bunny"
2
+
3
+ # Support both old and new rspec syntax.
4
+ RSpec.configure do |config|
5
+ config.expect_with :rspec do |c|
6
+ c.syntax = [:should, :expect]
7
+ end
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.11
4
+ version: 0.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -9,10 +9,10 @@ authors:
9
9
  - Jakub Stastny aka botanicus
10
10
  - Michael S. Klishin
11
11
  - Stefan Kaes
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-07-19 00:00:00.000000000 Z
15
+ date: 2023-03-26 00:00:00.000000000 Z
16
16
  dependencies: []
17
17
  description: A synchronous Ruby AMQP client that enables interaction with AMQP-compliant
18
18
  brokers.
@@ -36,7 +36,6 @@ files:
36
36
  - LICENSE
37
37
  - README.textile
38
38
  - Rakefile
39
- - bin/ci/before_build
40
39
  - bunny.gemspec
41
40
  - examples/simple_08.rb
42
41
  - examples/simple_09.rb
@@ -95,8 +94,10 @@ files:
95
94
  - spec/spec_09/connection_spec.rb
96
95
  - spec/spec_09/exchange_spec.rb
97
96
  - spec/spec_09/queue_spec.rb
97
+ - spec/spec_helper.rb
98
98
  homepage: http://github.com/ruby-amqp/bunny
99
- licenses: []
99
+ licenses:
100
+ - MIT
100
101
  metadata: {}
101
102
  post_install_message: "[\e[32mVersion 0.7.11\e[0m] support boolean values in message
102
103
  headers\n"
@@ -116,9 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
117
  - !ruby/object:Gem::Version
117
118
  version: '0'
118
119
  requirements: []
119
- rubyforge_project: bunny-amqp
120
- rubygems_version: 2.6.12
121
- signing_key:
120
+ rubygems_version: 3.4.6
121
+ signing_key:
122
122
  specification_version: 4
123
123
  summary: Synchronous Ruby AMQP 0.9.1 client
124
124
  test_files:
@@ -131,4 +131,4 @@ test_files:
131
131
  - spec/spec_09/connection_spec.rb
132
132
  - spec/spec_09/exchange_spec.rb
133
133
  - spec/spec_09/queue_spec.rb
134
- has_rdoc: true
134
+ - spec/spec_helper.rb
data/bin/ci/before_build DELETED
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $ctl = ENV["BUNNY_RABBITMQCTL"] || ENV["RABBITMQCTL"] || "sudo rabbitmqctl"
4
- $plugins = ENV["BUNNY_RABBITMQ_PLUGINS"] || ENV["RABBITMQ_PLUGINS"] || "sudo rabbitmq-plugins"
5
-
6
- def rabbit_control(args)
7
- command = "#{$ctl} #{args}"
8
- system command
9
- end
10
-
11
- def rabbit_plugins(args)
12
- command = "#{$plugins} #{args}"
13
- system command
14
- end
15
-
16
-
17
- # guest:guest has full access to /
18
-
19
- rabbit_control 'add_vhost /'
20
- rabbit_control 'add_user guest guest'
21
- rabbit_control 'set_permissions -p / guest ".*" ".*" ".*"'
22
-
23
-
24
- # bunny_gem:bunny_password has full access to bunny_testbed
25
-
26
- rabbit_control 'add_vhost bunny_testbed'
27
- rabbit_control 'add_user bunny_gem bunny_password'
28
- rabbit_control 'set_permissions -p bunny_testbed bunny_gem ".*" ".*" ".*"'
29
-
30
-
31
- # guest:guest has full access to bunny_testbed
32
-
33
- rabbit_control 'set_permissions -p bunny_testbed guest ".*" ".*" ".*"'
34
-
35
-
36
- # bunny_reader:reader_password has read access to bunny_testbed
37
-
38
- rabbit_control 'add_user bunny_reader reader_password'
39
- rabbit_control 'set_permissions -p bunny_testbed bunny_reader "^---$" "^---$" ".*"'
40
-
41
- # requires RabbitMQ 3.0+
42
- # rabbit_plugins 'enable rabbitmq_management'
43
-
44
- # Reduce retention policy for faster publishing of stats
45
- rabbit_control "eval 'supervisor2:terminate_child(rabbit_mgmt_sup_sup, rabbit_mgmt_sup), application:set_env(rabbitmq_management, sample_retention_policies, [{global, [{605, 1}]}, {basic, [{605, 1}]}, {detailed, [{10, 1}]}]), rabbit_mgmt_sup_sup:start_child().'"
46
- rabbit_control "eval 'supervisor2:terminate_child(rabbit_mgmt_agent_sup_sup, rabbit_mgmt_agent_sup), application:set_env(rabbitmq_management_agent, sample_retention_policies, [{global, [{605, 1}]}, {basic, [{605, 1}]}, {detailed, [{10, 1}]}]), rabbit_mgmt_agent_sup_sup:start_child().'"