amq-protocol 2.0.0 → 2.0.1
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 +4 -4
- data/README.md +1 -2
- data/lib/amq/protocol/client.rb +2 -1
- data/lib/amq/protocol/table.rb +8 -2
- data/lib/amq/protocol/table_value_decoder.rb +6 -0
- data/lib/amq/protocol/version.rb +1 -1
- data/spec/amq/protocol/table_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 592546ccd9dcc7fbaa136d8ba3b047cdf981e478
|
4
|
+
data.tar.gz: 269934dfff14063fcf9edc28bab301abadb28945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00fe19339769feb0337e136f05124b0a1d71e70568a3673710285d40016cf5569ac87f41bcae036a837b8cb10c079cd9c95a86f956dddc4d0b9fb10630a8c1ed
|
7
|
+
data.tar.gz: f498ce739314be78b14f5679725a58edf9caa5e266514a3fcfbdd899cba7deedf7a584f06436f42d5023872dea9a32384274a6d59c52141e62cc7ed2c24cf3b8
|
data/README.md
CHANGED
@@ -10,8 +10,7 @@ needs for you, including RabbitMQ extensions to AMQP 0.9.1.
|
|
10
10
|
## Supported Ruby Versions
|
11
11
|
|
12
12
|
amq-protocol `1.9.2` was the last version to support Ruby 1.8 and 1.9.
|
13
|
-
|
14
|
-
amq-protocol `2.0.0` and later will only support Ruby 2.0+.
|
13
|
+
amq-protocol `2.0.0` and later only supports Ruby 2.0+.
|
15
14
|
|
16
15
|
|
17
16
|
## Installation
|
data/lib/amq/protocol/client.rb
CHANGED
@@ -1437,7 +1437,8 @@ module AMQ
|
|
1437
1437
|
result = [60, 0].pack(PACK_UINT16_X2)
|
1438
1438
|
result += AMQ::Pack.pack_uint64_big_endian(body_size)
|
1439
1439
|
result += [flags].pack(PACK_UINT16)
|
1440
|
-
|
1440
|
+
pieces_joined = pieces.join(EMPTY_STRING)
|
1441
|
+
result.force_encoding(pieces_joined.encoding) + pieces_joined
|
1441
1442
|
end
|
1442
1443
|
|
1443
1444
|
# THIS DECODES ONLY FLAGS
|
data/lib/amq/protocol/table.rb
CHANGED
@@ -41,11 +41,11 @@ module AMQ
|
|
41
41
|
buffer << TYPE_HASH
|
42
42
|
buffer << self.encode(value)
|
43
43
|
else
|
44
|
-
buffer << TableValueEncoder.encode(value)
|
44
|
+
buffer << TableValueEncoder.encode(value).force_encoding(buffer.encoding)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
[buffer.bytesize].pack(PACK_UINT32) + buffer
|
48
|
+
[buffer.bytesize].pack(PACK_UINT32).force_encoding(buffer.encoding) + buffer
|
49
49
|
end
|
50
50
|
|
51
51
|
|
@@ -66,6 +66,12 @@ module AMQ
|
|
66
66
|
when TYPE_STRING
|
67
67
|
v, offset = TableValueDecoder.decode_string(data, offset)
|
68
68
|
v
|
69
|
+
when TYPE_BYTE_ARRAY
|
70
|
+
# Ruby doesn't have a direct counterpart to
|
71
|
+
# ByteBuffer or byte[], so using a string feels
|
72
|
+
# more appropriate than an array of fixnums
|
73
|
+
v, offset = TableValueDecoder.decode_string(data, offset)
|
74
|
+
v
|
69
75
|
when TYPE_INTEGER
|
70
76
|
v, offset = TableValueDecoder.decode_integer(data, offset)
|
71
77
|
v
|
@@ -35,6 +35,12 @@ module AMQ
|
|
35
35
|
when TYPE_STRING
|
36
36
|
v, offset = decode_string(data, offset)
|
37
37
|
v
|
38
|
+
when TYPE_BYTE_ARRAY
|
39
|
+
# Ruby doesn't have a direct counterpart to
|
40
|
+
# ByteBuffer or byte[], so using a string feels
|
41
|
+
# more appropriate than an array of fixnums
|
42
|
+
v, offset = decode_string(data, offset)
|
43
|
+
v
|
38
44
|
when TYPE_INTEGER
|
39
45
|
v, offset = decode_integer(data, offset)
|
40
46
|
v
|
data/lib/amq/protocol/version.rb
CHANGED
@@ -93,6 +93,12 @@ module AMQ
|
|
93
93
|
it "is capable of decoding string table values" do
|
94
94
|
input = { "stringvalue" => "string" }
|
95
95
|
expect(Table.decode(Table.encode(input))).to eq(input)
|
96
|
+
|
97
|
+
expect(Table.decode("\x00\x00\x00\x17\vstringvalueS\x00\x00\x00\x06string")).to eq(input)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "is capable of decoding byte array table values (as Ruby strings)" do
|
101
|
+
expect(Table.decode("\x00\x00\x00\x17\vstringvaluex\x00\x00\x00\x06string")).to eq({"stringvalue" => "string"})
|
96
102
|
end
|
97
103
|
|
98
104
|
it "is capable of decoding string table values with UTF-8 characters" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amq-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Stastny
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-12-17 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |2
|
17
17
|
amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not a
|