bunny 0.7.2 → 0.7.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.
- data/lib/bunny/client08.rb +2 -2
- data/lib/bunny/client09.rb +1 -1
- data/lib/bunny/version.rb +1 -1
- data/lib/qrack/client.rb +8 -0
- data/spec/spec_09/amqp_url_spec.rb +18 -0
- metadata +4 -13
data/lib/bunny/client08.rb
CHANGED
@@ -51,8 +51,8 @@ Sets up a Bunny::Client object ready for connection to a broker/server. _Client_
|
|
51
51
|
def initialize(connection_string_or_opts = Hash.new, opts = Hash.new)
|
52
52
|
super
|
53
53
|
@spec = '0-8'
|
54
|
-
@port =
|
55
|
-
@insist =
|
54
|
+
@port = self.__opts__[:port] || (self.__opts__[:ssl] ? Qrack::Protocol::SSL_PORT : Qrack::Protocol::PORT)
|
55
|
+
@insist = self.__opts__[:insist]
|
56
56
|
end
|
57
57
|
|
58
58
|
=begin rdoc
|
data/lib/bunny/client09.rb
CHANGED
@@ -33,7 +33,7 @@ module Bunny
|
|
33
33
|
def initialize(connection_string_or_opts = Hash.new, opts = Hash.new)
|
34
34
|
super
|
35
35
|
@spec = '0-9-1'
|
36
|
-
@port =
|
36
|
+
@port = self.__opts__[:port] || (self.__opts__[:ssl] ? Qrack::Protocol09::SSL_PORT : Qrack::Protocol09::PORT)
|
37
37
|
end
|
38
38
|
|
39
39
|
# Checks response from AMQP methods and takes appropriate action
|
data/lib/bunny/version.rb
CHANGED
data/lib/qrack/client.rb
CHANGED
@@ -16,6 +16,9 @@ module Qrack
|
|
16
16
|
attr_reader :status, :host, :vhost, :port, :logging, :spec, :heartbeat
|
17
17
|
attr_accessor :channel, :logfile, :exchanges, :queues, :channels, :message_in, :message_out, :connecting
|
18
18
|
|
19
|
+
# Temporary hack to make Bunny 0.7 work with port number in AMQP URL.
|
20
|
+
# This is not necessary on Bunny 0.8 as it removes support of AMQP 0.8.
|
21
|
+
attr_reader :__opts__
|
19
22
|
|
20
23
|
def initialize(connection_string_or_opts = Hash.new, opts = Hash.new)
|
21
24
|
opts = case connection_string_or_opts
|
@@ -27,6 +30,11 @@ module Qrack
|
|
27
30
|
Hash.new
|
28
31
|
end.merge(opts)
|
29
32
|
|
33
|
+
# Temporary hack to make Bunny 0.7 work with port number in AMQP URL.
|
34
|
+
# This is not necessary on Bunny 0.8 as it removes support of AMQP 0.8.
|
35
|
+
@__opts__ = opts
|
36
|
+
|
37
|
+
|
30
38
|
@host = opts[:host] || 'localhost'
|
31
39
|
@user = opts[:user] || 'guest'
|
32
40
|
@pass = opts[:pass] || 'guest'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Assumes that target message broker/server has a user called 'guest' with a password 'guest'
|
4
|
+
# and that it is running on 'localhost'.
|
5
|
+
|
6
|
+
# If this is not the case, please change the 'Bunny.new' call below to include
|
7
|
+
# the relevant arguments e.g. @b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar')
|
8
|
+
|
9
|
+
require "bunny"
|
10
|
+
|
11
|
+
describe Bunny do
|
12
|
+
context "AMQP URL parsing" do
|
13
|
+
it "handles port properly" do
|
14
|
+
bunny = Bunny.new("amqp://dev.rabbitmq.com:1212")
|
15
|
+
bunny.port.should eql(1212)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 7
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 7
|
9
|
-
- 2
|
10
|
-
version: 0.7.2
|
5
|
+
version: 0.7.3
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Chris Duncan
|
@@ -19,7 +14,7 @@ autorequire:
|
|
19
14
|
bindir: bin
|
20
15
|
cert_chain: []
|
21
16
|
|
22
|
-
date: 2011-07-
|
17
|
+
date: 2011-07-27 00:00:00 -07:00
|
23
18
|
default_executable:
|
24
19
|
dependencies: []
|
25
20
|
|
@@ -98,6 +93,7 @@ files:
|
|
98
93
|
- spec/spec_08/connection_spec.rb
|
99
94
|
- spec/spec_08/exchange_spec.rb
|
100
95
|
- spec/spec_08/queue_spec.rb
|
96
|
+
- spec/spec_09/amqp_url_spec.rb
|
101
97
|
- spec/spec_09/bunny_spec.rb
|
102
98
|
- spec/spec_09/connection_spec.rb
|
103
99
|
- spec/spec_09/exchange_spec.rb
|
@@ -117,18 +113,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
113
|
requirements:
|
118
114
|
- - ">="
|
119
115
|
- !ruby/object:Gem::Version
|
120
|
-
hash: 3
|
121
|
-
segments:
|
122
|
-
- 0
|
123
116
|
version: "0"
|
124
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
118
|
none: false
|
126
119
|
requirements:
|
127
120
|
- - ">="
|
128
121
|
- !ruby/object:Gem::Version
|
129
|
-
hash: 3
|
130
|
-
segments:
|
131
|
-
- 0
|
132
122
|
version: "0"
|
133
123
|
requirements: []
|
134
124
|
|
@@ -142,6 +132,7 @@ test_files:
|
|
142
132
|
- spec/spec_08/connection_spec.rb
|
143
133
|
- spec/spec_08/exchange_spec.rb
|
144
134
|
- spec/spec_08/queue_spec.rb
|
135
|
+
- spec/spec_09/amqp_url_spec.rb
|
145
136
|
- spec/spec_09/bunny_spec.rb
|
146
137
|
- spec/spec_09/connection_spec.rb
|
147
138
|
- spec/spec_09/exchange_spec.rb
|