bunny 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGELOG +1 -2
- data/ext/qparser.rb +8 -2
- data/lib/bunny/version.rb +1 -1
- data/lib/qrack/protocol/spec08.rb +5 -4
- data/lib/qrack/protocol/spec09.rb +5 -4
- data/lib/qrack/transport/frame08.rb +11 -10
- data/lib/qrack/transport/frame09.rb +7 -6
- data/spec/spec_08/queue_spec.rb +15 -0
- metadata +14 -5
- data/Gemfile.lock +0 -34
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
data/ext/qparser.rb
CHANGED
@@ -217,6 +217,9 @@ class_defs = classes(spec, spec_info['major'], spec_info['minor'], spec_info['re
|
|
217
217
|
spec_rb = File.open(CONFIG[:spec_out], 'w')
|
218
218
|
spec_rb.puts(
|
219
219
|
ERB.new(%q[
|
220
|
+
# encoding: utf-8
|
221
|
+
|
222
|
+
|
220
223
|
#:stopdoc:
|
221
224
|
# this file was autogenerated on <%= Time.now.to_s %>
|
222
225
|
# using <%= specfile.ljust(16) %> (mtime: <%= File.mtime(specpath) %>)
|
@@ -257,7 +260,7 @@ ERB.new(%q[
|
|
257
260
|
def properties() @properties ||= [] end
|
258
261
|
|
259
262
|
def id() self::ID end
|
260
|
-
def name() self::NAME end
|
263
|
+
def name() self::NAME.to_s end
|
261
264
|
end
|
262
265
|
|
263
266
|
class Method
|
@@ -275,7 +278,7 @@ ERB.new(%q[
|
|
275
278
|
|
276
279
|
def parent() Protocol.const_get(self.to_s[/Protocol::(.+?)::/,1]) end
|
277
280
|
def id() self::ID end
|
278
|
-
def name() self::NAME end
|
281
|
+
def name() self::NAME.to_s end
|
279
282
|
end
|
280
283
|
|
281
284
|
def == b
|
@@ -364,6 +367,9 @@ spec_rb.close
|
|
364
367
|
frame_rb = File.open(CONFIG[:frame_out], 'w')
|
365
368
|
frame_rb.puts(
|
366
369
|
ERB.new(%q[
|
370
|
+
# encoding: utf-8
|
371
|
+
|
372
|
+
|
367
373
|
#:stopdoc:
|
368
374
|
# this file was autogenerated on <%= Time.now.to_s %>
|
369
375
|
#
|
data/lib/bunny/version.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
|
1
2
|
# encoding: utf-8
|
2
3
|
|
3
4
|
|
4
5
|
#:stopdoc:
|
5
|
-
# this file was autogenerated on
|
6
|
-
# using amqp-0.8.json (mtime:
|
6
|
+
# this file was autogenerated on 2011-07-21 07:15:33 +0100
|
7
|
+
# using amqp-0.8.json (mtime: 2011-07-20 19:11:32 +0100)
|
7
8
|
#
|
8
9
|
# DO NOT EDIT! (edit ext/qparser.rb and config.yml instead, and run 'ruby qparser.rb')
|
9
10
|
|
@@ -62,7 +63,7 @@ module Qrack
|
|
62
63
|
def properties() @properties ||= [] end
|
63
64
|
|
64
65
|
def id() self::ID end
|
65
|
-
def name() self::NAME end
|
66
|
+
def name() self::NAME.to_s end
|
66
67
|
end
|
67
68
|
|
68
69
|
class Method
|
@@ -80,7 +81,7 @@ module Qrack
|
|
80
81
|
|
81
82
|
def parent() Protocol.const_get(self.to_s[/Protocol::(.+?)::/,1]) end
|
82
83
|
def id() self::ID end
|
83
|
-
def name() self::NAME end
|
84
|
+
def name() self::NAME.to_s end
|
84
85
|
end
|
85
86
|
|
86
87
|
def == b
|
@@ -1,9 +1,10 @@
|
|
1
|
+
|
1
2
|
# encoding: utf-8
|
2
3
|
|
3
4
|
|
4
5
|
#:stopdoc:
|
5
|
-
# this file was autogenerated on
|
6
|
-
# using amqp-0.9.1.json (mtime:
|
6
|
+
# this file was autogenerated on 2011-07-21 07:07:06 +0100
|
7
|
+
# using amqp-0.9.1.json (mtime: 2011-07-20 19:10:34 +0100)
|
7
8
|
#
|
8
9
|
# DO NOT EDIT! (edit ext/qparser.rb and config.yml instead, and run 'ruby qparser.rb')
|
9
10
|
|
@@ -62,7 +63,7 @@ module Qrack
|
|
62
63
|
def properties() @properties ||= [] end
|
63
64
|
|
64
65
|
def id() self::ID end
|
65
|
-
def name() self::NAME end
|
66
|
+
def name() self::NAME.to_s end
|
66
67
|
end
|
67
68
|
|
68
69
|
class Method
|
@@ -80,7 +81,7 @@ module Qrack
|
|
80
81
|
|
81
82
|
def parent() Protocol09.const_get(self.to_s[/Protocol09::(.+?)::/,1]) end
|
82
83
|
def id() self::ID end
|
83
|
-
def name() self::NAME end
|
84
|
+
def name() self::NAME.to_s end
|
84
85
|
end
|
85
86
|
|
86
87
|
def == b
|
@@ -1,8 +1,9 @@
|
|
1
|
+
|
1
2
|
# encoding: utf-8
|
2
3
|
|
3
4
|
|
4
5
|
#:stopdoc:
|
5
|
-
# this file was autogenerated on
|
6
|
+
# this file was autogenerated on 2011-07-21 07:15:33 +0100
|
6
7
|
#
|
7
8
|
# DO NOT EDIT! (edit ext/qparser.rb and config.yml instead, and run 'ruby qparser.rb')
|
8
9
|
|
@@ -14,15 +15,15 @@ module Qrack
|
|
14
15
|
ID = 0
|
15
16
|
|
16
17
|
@types = {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
1 => 'Method',
|
19
|
+
2 => 'Header',
|
20
|
+
3 => 'Body',
|
21
|
+
4 => 'OobMethod',
|
22
|
+
5 => 'OobHeader',
|
23
|
+
6 => 'OobBody',
|
24
|
+
7 => 'Trace',
|
25
|
+
8 => 'Heartbeat',
|
26
|
+
}
|
26
27
|
|
27
28
|
attr_accessor :channel, :payload
|
28
29
|
|
@@ -1,8 +1,9 @@
|
|
1
|
+
|
1
2
|
# encoding: utf-8
|
2
3
|
|
3
4
|
|
4
5
|
#:stopdoc:
|
5
|
-
# this file was autogenerated on
|
6
|
+
# this file was autogenerated on 2011-07-21 07:07:06 +0100
|
6
7
|
#
|
7
8
|
# DO NOT EDIT! (edit ext/qparser.rb and config.yml instead, and run 'ruby qparser.rb')
|
8
9
|
|
@@ -14,11 +15,11 @@ module Qrack
|
|
14
15
|
ID = 0
|
15
16
|
|
16
17
|
@types = {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
1 => 'Method',
|
19
|
+
2 => 'Header',
|
20
|
+
3 => 'Body',
|
21
|
+
8 => 'Heartbeat',
|
22
|
+
}
|
22
23
|
|
23
24
|
attr_accessor :channel, :payload
|
24
25
|
|
data/spec/spec_08/queue_spec.rb
CHANGED
@@ -12,6 +12,10 @@ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib bunny]))
|
|
12
12
|
|
13
13
|
describe 'Queue' do
|
14
14
|
|
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
|
17
|
+
end
|
18
|
+
|
15
19
|
before(:each) do
|
16
20
|
@b = Bunny.new
|
17
21
|
@b.start
|
@@ -59,6 +63,7 @@ describe 'Queue' do
|
|
59
63
|
|
60
64
|
it "should be able to publish a message" do
|
61
65
|
q = @b.queue('test1')
|
66
|
+
expect_deprecation_warning_for_publishing_on_queue(q)
|
62
67
|
q.publish('This is a test message')
|
63
68
|
q.message_count.should == 1
|
64
69
|
end
|
@@ -75,6 +80,7 @@ describe 'Queue' do
|
|
75
80
|
|
76
81
|
it "should be able to pop a message and just get the payload" do
|
77
82
|
q = @b.queue('test1')
|
83
|
+
expect_deprecation_warning_for_publishing_on_queue(q)
|
78
84
|
q.publish('This is another test message')
|
79
85
|
msg = q.pop[:payload]
|
80
86
|
msg.should == 'This is another test message'
|
@@ -84,6 +90,7 @@ describe 'Queue' do
|
|
84
90
|
it "should be able to pop a message where body length exceeds max frame size" do
|
85
91
|
q = @b.queue('test1')
|
86
92
|
lg_msg = 'z' * 142000
|
93
|
+
expect_deprecation_warning_for_publishing_on_queue(q)
|
87
94
|
q.publish(lg_msg)
|
88
95
|
msg = q.pop[:payload]
|
89
96
|
msg.should == lg_msg
|
@@ -91,6 +98,7 @@ describe 'Queue' do
|
|
91
98
|
|
92
99
|
it "should be able call a block when popping a message" do
|
93
100
|
q = @b.queue('test1')
|
101
|
+
expect_deprecation_warning_for_publishing_on_queue(q)
|
94
102
|
q.publish('This is another test message')
|
95
103
|
q.pop { |msg| msg[:payload].should == 'This is another test message' }
|
96
104
|
q.pop { |msg| msg[:payload].should == :queue_empty }
|
@@ -98,6 +106,7 @@ describe 'Queue' do
|
|
98
106
|
|
99
107
|
it "should raise an error if purge fails" do
|
100
108
|
q = @b.queue('test1')
|
109
|
+
expect_deprecation_warning_for_publishing_on_queue(q, 5)
|
101
110
|
5.times {q.publish('This is another test message')}
|
102
111
|
q.message_count.should == 5
|
103
112
|
lambda {q.purge(:queue => 'bogus')}.should raise_error(Bunny::ForcedChannelCloseError)
|
@@ -112,6 +121,7 @@ describe 'Queue' do
|
|
112
121
|
|
113
122
|
it "should return an empty message when popping an empty queue" do
|
114
123
|
q = @b.queue('test1')
|
124
|
+
expect_deprecation_warning_for_publishing_on_queue(q)
|
115
125
|
q.publish('This is another test message')
|
116
126
|
q.pop
|
117
127
|
msg = q.pop[:payload]
|
@@ -120,6 +130,7 @@ describe 'Queue' do
|
|
120
130
|
|
121
131
|
it "should stop subscription without processing messages if max specified is 0" do
|
122
132
|
q = @b.queue('test1')
|
133
|
+
expect_deprecation_warning_for_publishing_on_queue(q, 5)
|
123
134
|
5.times {q.publish('Yet another test message')}
|
124
135
|
q.message_count.should == 5
|
125
136
|
q.subscribe(:message_max => 0)
|
@@ -129,6 +140,7 @@ describe 'Queue' do
|
|
129
140
|
|
130
141
|
it "should stop subscription after processing number of messages specified > 0" do
|
131
142
|
q = @b.queue('test1')
|
143
|
+
expect_deprecation_warning_for_publishing_on_queue(q, 5)
|
132
144
|
5.times {q.publish('Yet another test message')}
|
133
145
|
q.message_count.should == 5
|
134
146
|
q.subscribe(:message_max => 5)
|
@@ -137,6 +149,7 @@ describe 'Queue' do
|
|
137
149
|
it "should stop subscription after processing message_max messages < total in queue" do
|
138
150
|
q = @b.queue('test1')
|
139
151
|
@b.qos()
|
152
|
+
expect_deprecation_warning_for_publishing_on_queue(q, 10)
|
140
153
|
10.times {q.publish('Yet another test message')}
|
141
154
|
q.message_count.should == 10
|
142
155
|
q.subscribe(:message_max => 5, :ack => true)
|
@@ -152,6 +165,7 @@ describe 'Queue' do
|
|
152
165
|
|
153
166
|
it "should pass correct block parameters through on subscribe" do
|
154
167
|
q = @b.queue('test1')
|
168
|
+
expect_deprecation_warning_for_publishing_on_queue(q)
|
155
169
|
q.publish("messages pop\'n")
|
156
170
|
|
157
171
|
q.subscribe do |msg|
|
@@ -166,6 +180,7 @@ describe 'Queue' do
|
|
166
180
|
|
167
181
|
it "should finish processing subscription messages if break is called in block" do
|
168
182
|
q = @b.queue('test1')
|
183
|
+
expect_deprecation_warning_for_publishing_on_queue(q, 6)
|
169
184
|
q.publish('messages in my quezen')
|
170
185
|
|
171
186
|
q.subscribe do |msg|
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 7
|
9
|
+
- 2
|
10
|
+
version: 0.7.2
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Chris Duncan
|
@@ -14,7 +19,7 @@ autorequire:
|
|
14
19
|
bindir: bin
|
15
20
|
cert_chain: []
|
16
21
|
|
17
|
-
date: 2011-07-
|
22
|
+
date: 2011-07-25 00:00:00 +04:00
|
18
23
|
default_executable:
|
19
24
|
dependencies: []
|
20
25
|
|
@@ -38,7 +43,6 @@ files:
|
|
38
43
|
- .yardopts
|
39
44
|
- CHANGELOG
|
40
45
|
- Gemfile
|
41
|
-
- Gemfile.lock
|
42
46
|
- LICENSE
|
43
47
|
- README.textile
|
44
48
|
- Rakefile
|
@@ -102,8 +106,7 @@ has_rdoc: true
|
|
102
106
|
homepage: http://github.com/ruby-amqp/bunny
|
103
107
|
licenses: []
|
104
108
|
|
105
|
-
post_install_message: "[\e[32mVersion 0.
|
106
|
-
[\e[32mVersion 0.7\e[0m] Queue#publish deprecated.\n"
|
109
|
+
post_install_message: "[\e[32mVersion 0.6.3\e[0m] Encoding of source files is set to UTF-8 on Ruby 1.9.\n"
|
107
110
|
rdoc_options:
|
108
111
|
- --main
|
109
112
|
- README.rdoc
|
@@ -114,12 +117,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
117
|
requirements:
|
115
118
|
- - ">="
|
116
119
|
- !ruby/object:Gem::Version
|
120
|
+
hash: 3
|
121
|
+
segments:
|
122
|
+
- 0
|
117
123
|
version: "0"
|
118
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
125
|
none: false
|
120
126
|
requirements:
|
121
127
|
- - ">="
|
122
128
|
- !ruby/object:Gem::Version
|
129
|
+
hash: 3
|
130
|
+
segments:
|
131
|
+
- 0
|
123
132
|
version: "0"
|
124
133
|
requirements: []
|
125
134
|
|
data/Gemfile.lock
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
bunny (0.7)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://rubygems.org/
|
8
|
-
specs:
|
9
|
-
RedCloth (4.2.7)
|
10
|
-
SystemTimer (1.2)
|
11
|
-
changelog (0.8)
|
12
|
-
diff-lcs (1.1.2)
|
13
|
-
rake (0.9.2)
|
14
|
-
rspec (2.6.0)
|
15
|
-
rspec-core (~> 2.6.0)
|
16
|
-
rspec-expectations (~> 2.6.0)
|
17
|
-
rspec-mocks (~> 2.6.0)
|
18
|
-
rspec-core (2.6.4)
|
19
|
-
rspec-expectations (2.6.0)
|
20
|
-
diff-lcs (~> 1.1.2)
|
21
|
-
rspec-mocks (2.6.0)
|
22
|
-
yard (0.7.2)
|
23
|
-
|
24
|
-
PLATFORMS
|
25
|
-
ruby
|
26
|
-
|
27
|
-
DEPENDENCIES
|
28
|
-
RedCloth
|
29
|
-
SystemTimer (= 1.2)
|
30
|
-
bunny!
|
31
|
-
changelog
|
32
|
-
rake
|
33
|
-
rspec (~> 2.6.0)
|
34
|
-
yard (>= 0.7.2)
|