amq-protocol 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,9 +5,9 @@ rvm:
5
5
  - 1.8.7
6
6
  - 1.9.2
7
7
  - jruby
8
- - rbx
8
+ - rbx-2.0
9
9
  - ree
10
- - 1.8.7-p174
10
+ - ruby-head
11
11
  notifications:
12
12
  recipients:
13
13
  - jakub@rabbitmq.com
@@ -244,7 +244,7 @@ module AMQ
244
244
  end
245
245
 
246
246
  def self.encode_body(body, channel, frame_size)
247
- return [BodyFrame.new(body, channel)] if body.empty?
247
+ return [] if body.empty?
248
248
 
249
249
  # See https://dev.rabbitmq.com/wiki/Amqp091Errata#section_11
250
250
  limit = frame_size - 8
@@ -1,5 +1,5 @@
1
1
  module AMQ
2
2
  module Protocol
3
- VERSION = "0.7.0"
3
+ VERSION = "0.8.0"
4
4
  end # Protocol
5
5
  end # AMQ
@@ -184,7 +184,7 @@ module AMQ
184
184
  end
185
185
 
186
186
  def self.encode_body(body, channel, frame_size)
187
- return [BodyFrame.new(body, channel)] if body.empty?
187
+ return [] if body.empty?
188
188
 
189
189
  # See https://dev.rabbitmq.com/wiki/Amqp091Errata#section_11
190
190
  limit = frame_size - 8
@@ -0,0 +1,14 @@
1
+ # encoding: binary
2
+
3
+ require File.expand_path('../../../spec_helper', __FILE__)
4
+
5
+
6
+ describe AMQ::Protocol::Method, ".encode_body" do
7
+ it "encodes 1-byte long payload as exactly 1 body frame" do
8
+ described_class.encode_body('1', 1, 65536).size.should == 1
9
+ end
10
+
11
+ it "encodes 0-byte long (blank) payload as exactly 0 body frame" do
12
+ described_class.encode_body('', 1, 65536).size.should == 0
13
+ end
14
+ end
@@ -94,4 +94,4 @@ module AMQ
94
94
  end
95
95
  end
96
96
  end
97
- end
97
+ end
data/tasks.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env bundle exec nake
2
2
  # encoding: utf-8
3
3
 
4
- load "contributors.nake"
5
-
6
4
  # ./tasks.rb generate
7
5
  # ./tasks.rb generate --targets=all,
8
6
  # ./tasks.rb generate --targets=client,server
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amq-protocol
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 7
8
+ - 8
9
9
  - 0
10
- version: 0.7.0
10
+ version: 0.8.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jakub Stastny
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-07-17 00:00:00 +04:00
21
+ date: 2011-07-21 00:00:00 +04:00
22
22
  default_executable:
23
23
  dependencies: []
24
24
 
@@ -60,6 +60,7 @@ files:
60
60
  - protocol.rb.pytemplate
61
61
  - spec/amq/hacks_spec.rb
62
62
  - spec/amq/protocol/basic_spec.rb
63
+ - spec/amq/protocol/blank_body_encoding_spec.rb
63
64
  - spec/amq/protocol/channel_spec.rb
64
65
  - spec/amq/protocol/confirm_spec.rb
65
66
  - spec/amq/protocol/connection_spec.rb