amq-protocol 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/ChangeLog.md +18 -0
- data/Gemfile +1 -1
- data/LICENSE +1 -1
- data/codegen/protocol.rb.pytemplate +5 -4
- data/lib/amq/int_allocator.rb +2 -2
- data/lib/amq/protocol/client.rb +39 -39
- data/lib/amq/protocol/table.rb +0 -1
- data/lib/amq/protocol/table_value_decoder.rb +0 -2
- data/lib/amq/protocol/table_value_encoder.rb +3 -5
- data/lib/amq/protocol/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46955b1476f90b2f8042cea8cc99da3a7d65113b
|
4
|
+
data.tar.gz: 674e9e912348247303eb1b1f4e73c75ab0548760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd57c461bfaec17595a464815a7e7ccc161570da1debcd2cd737a87184b0135302ba73ab1205ada5eae11cac1d97dc6a09742b651732259eaa064ad89cadd1a3
|
7
|
+
data.tar.gz: 55c686b11f1f28a63353785291807cc09f478deb2f06177c535080653d0540b26da029068dbaf265eda86a05944642fd682eb742756c85c414dca5de5f43fdb4
|
data/.travis.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## Changes between 2.0.0 and 2.1.0
|
2
|
+
|
3
|
+
### Ruby Warnings Squashed
|
4
|
+
|
5
|
+
Contributed by Akira Matsuda.
|
6
|
+
|
7
|
+
GitHub issue: [#62](https://github.com/ruby-amqp/amq-protocol/pull/62)
|
8
|
+
|
9
|
+
### Byte Array Decoding
|
10
|
+
|
11
|
+
Byte array values in types now can be
|
12
|
+
decoded (to the extent Ruby type system
|
13
|
+
permits) by this library.
|
14
|
+
|
15
|
+
GitHub issue: [#58](https://github.com/ruby-amqp/amq-protocol/issues/58)
|
16
|
+
|
17
|
+
|
18
|
+
|
1
19
|
## Changes between 1.9.x and 2.0.0
|
2
20
|
|
3
21
|
2.0.0 has **breaking changes** in header encoding.
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Copyright (c) 2010 – 2011 Jakub Šťastný aka Botanicus
|
2
|
-
Copyright (c) 2011 –
|
2
|
+
Copyright (c) 2011 – 2016 Michael S. Klishin <michael@defprotocol.org>
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
a copy of this software and associated documentation files (the
|
@@ -114,7 +114,7 @@ module AMQ
|
|
114
114
|
body.force_encoding("ASCII-8BIT") if RUBY_VERSION.to_f >= 1.9
|
115
115
|
|
116
116
|
array = Array.new
|
117
|
-
while body
|
117
|
+
while body && !body.empty?
|
118
118
|
payload, body = body[0, limit], body[limit, body.length - limit]
|
119
119
|
array << BodyFrame.new(payload, channel)
|
120
120
|
end
|
@@ -167,7 +167,8 @@ module AMQ
|
|
167
167
|
result = [${klass.index}, 0].pack(PACK_UINT16_X2)
|
168
168
|
result += AMQ::Pack.pack_uint64_big_endian(body_size)
|
169
169
|
result += [flags].pack(PACK_UINT16)
|
170
|
-
|
170
|
+
pieces_joined = pieces.join(EMPTY_STRING)
|
171
|
+
result.force_encoding(pieces_joined.encoding) + pieces_joined
|
171
172
|
end
|
172
173
|
|
173
174
|
# THIS DECODES ONLY FLAGS
|
@@ -235,7 +236,7 @@ module AMQ
|
|
235
236
|
% if (spec.type == "client" and method.accepted_by("client")) or (spec.type == "server" and method.accepted_by("server") or spec.type == "all"):
|
236
237
|
# @return
|
237
238
|
def self.decode(data)
|
238
|
-
offset = 0
|
239
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
239
240
|
% for line in helpers.genDecodeMethodDefinition(spec, method):
|
240
241
|
${line}
|
241
242
|
% endfor
|
@@ -285,7 +286,7 @@ module AMQ
|
|
285
286
|
% if "payload" in method.args() or "user_headers" in method.args():
|
286
287
|
frames = [MethodFrame.new(buffer, channel)]
|
287
288
|
% if "user_headers" in method.args():
|
288
|
-
properties,
|
289
|
+
properties, _headers = self.split_headers(user_headers)
|
289
290
|
if properties.nil? or properties.empty?
|
290
291
|
raise RuntimeError.new("Properties can not be empty!")
|
291
292
|
end
|
data/lib/amq/int_allocator.rb
CHANGED
@@ -36,12 +36,12 @@ module AMQ
|
|
36
36
|
end # initialize(hi, lo)
|
37
37
|
|
38
38
|
# Attempts to allocate next available integer. If allocation succeeds, allocated value is returned.
|
39
|
-
# Otherwise,
|
39
|
+
# Otherwise, -1 is returned.
|
40
40
|
#
|
41
41
|
# Current implementation of this method is O(n), where n is number of bits in the range available for
|
42
42
|
# allocation.
|
43
43
|
#
|
44
|
-
# @return [Integer] Allocated integer if allocation succeeded.
|
44
|
+
# @return [Integer] Allocated integer if allocation succeeded. -1 otherwise.
|
45
45
|
def allocate
|
46
46
|
|
47
47
|
if n = @free_set.next_clear_bit
|
data/lib/amq/protocol/client.rb
CHANGED
@@ -204,7 +204,7 @@ module AMQ
|
|
204
204
|
|
205
205
|
# @return
|
206
206
|
def self.decode(data)
|
207
|
-
offset = 0
|
207
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
208
208
|
version_major = data[offset, 1].unpack(PACK_CHAR).first
|
209
209
|
offset += 1
|
210
210
|
version_minor = data[offset, 1].unpack(PACK_CHAR).first
|
@@ -275,7 +275,7 @@ module AMQ
|
|
275
275
|
|
276
276
|
# @return
|
277
277
|
def self.decode(data)
|
278
|
-
offset = 0
|
278
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
279
279
|
length = data[offset, 4].unpack(PACK_UINT32).first
|
280
280
|
offset += 4
|
281
281
|
challenge = data[offset, length]
|
@@ -326,7 +326,7 @@ module AMQ
|
|
326
326
|
|
327
327
|
# @return
|
328
328
|
def self.decode(data)
|
329
|
-
offset = 0
|
329
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
330
330
|
channel_max = data[offset, 2].unpack(PACK_UINT16).first
|
331
331
|
offset += 2
|
332
332
|
frame_max = data[offset, 4].unpack(PACK_UINT32).first
|
@@ -412,7 +412,7 @@ module AMQ
|
|
412
412
|
|
413
413
|
# @return
|
414
414
|
def self.decode(data)
|
415
|
-
offset = 0
|
415
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
416
416
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
417
417
|
offset += 1
|
418
418
|
known_hosts = data[offset, length]
|
@@ -440,7 +440,7 @@ module AMQ
|
|
440
440
|
|
441
441
|
# @return
|
442
442
|
def self.decode(data)
|
443
|
-
offset = 0
|
443
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
444
444
|
reply_code = data[offset, 2].unpack(PACK_UINT16).first
|
445
445
|
offset += 2
|
446
446
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
@@ -489,7 +489,7 @@ module AMQ
|
|
489
489
|
|
490
490
|
# @return
|
491
491
|
def self.decode(data)
|
492
|
-
offset = 0
|
492
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
493
493
|
self.new()
|
494
494
|
end
|
495
495
|
|
@@ -518,7 +518,7 @@ module AMQ
|
|
518
518
|
|
519
519
|
# @return
|
520
520
|
def self.decode(data)
|
521
|
-
offset = 0
|
521
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
522
522
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
523
523
|
offset += 1
|
524
524
|
reason = data[offset, length]
|
@@ -555,7 +555,7 @@ module AMQ
|
|
555
555
|
|
556
556
|
# @return
|
557
557
|
def self.decode(data)
|
558
|
-
offset = 0
|
558
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
559
559
|
self.new()
|
560
560
|
end
|
561
561
|
|
@@ -614,7 +614,7 @@ module AMQ
|
|
614
614
|
|
615
615
|
# @return
|
616
616
|
def self.decode(data)
|
617
|
-
offset = 0
|
617
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
618
618
|
length = data[offset, 4].unpack(PACK_UINT32).first
|
619
619
|
offset += 4
|
620
620
|
channel_id = data[offset, length]
|
@@ -642,7 +642,7 @@ module AMQ
|
|
642
642
|
|
643
643
|
# @return
|
644
644
|
def self.decode(data)
|
645
|
-
offset = 0
|
645
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
646
646
|
bit_buffer = data[offset, 1].unpack(PACK_CHAR).first
|
647
647
|
offset += 1
|
648
648
|
active = (bit_buffer & (1 << 0)) != 0
|
@@ -678,7 +678,7 @@ module AMQ
|
|
678
678
|
|
679
679
|
# @return
|
680
680
|
def self.decode(data)
|
681
|
-
offset = 0
|
681
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
682
682
|
bit_buffer = data[offset, 1].unpack(PACK_CHAR).first
|
683
683
|
offset += 1
|
684
684
|
active = (bit_buffer & (1 << 0)) != 0
|
@@ -714,7 +714,7 @@ module AMQ
|
|
714
714
|
|
715
715
|
# @return
|
716
716
|
def self.decode(data)
|
717
|
-
offset = 0
|
717
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
718
718
|
reply_code = data[offset, 2].unpack(PACK_UINT16).first
|
719
719
|
offset += 2
|
720
720
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
@@ -762,7 +762,7 @@ module AMQ
|
|
762
762
|
|
763
763
|
# @return
|
764
764
|
def self.decode(data)
|
765
|
-
offset = 0
|
765
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
766
766
|
self.new()
|
767
767
|
end
|
768
768
|
|
@@ -832,7 +832,7 @@ module AMQ
|
|
832
832
|
|
833
833
|
# @return
|
834
834
|
def self.decode(data)
|
835
|
-
offset = 0
|
835
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
836
836
|
self.new()
|
837
837
|
end
|
838
838
|
|
@@ -882,7 +882,7 @@ module AMQ
|
|
882
882
|
|
883
883
|
# @return
|
884
884
|
def self.decode(data)
|
885
|
-
offset = 0
|
885
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
886
886
|
self.new()
|
887
887
|
end
|
888
888
|
|
@@ -936,7 +936,7 @@ module AMQ
|
|
936
936
|
|
937
937
|
# @return
|
938
938
|
def self.decode(data)
|
939
|
-
offset = 0
|
939
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
940
940
|
self.new()
|
941
941
|
end
|
942
942
|
|
@@ -990,7 +990,7 @@ module AMQ
|
|
990
990
|
|
991
991
|
# @return
|
992
992
|
def self.decode(data)
|
993
|
-
offset = 0
|
993
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
994
994
|
self.new()
|
995
995
|
end
|
996
996
|
|
@@ -1052,7 +1052,7 @@ module AMQ
|
|
1052
1052
|
|
1053
1053
|
# @return
|
1054
1054
|
def self.decode(data)
|
1055
|
-
offset = 0
|
1055
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1056
1056
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
1057
1057
|
offset += 1
|
1058
1058
|
queue = data[offset, length]
|
@@ -1118,7 +1118,7 @@ module AMQ
|
|
1118
1118
|
|
1119
1119
|
# @return
|
1120
1120
|
def self.decode(data)
|
1121
|
-
offset = 0
|
1121
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1122
1122
|
self.new()
|
1123
1123
|
end
|
1124
1124
|
|
@@ -1167,7 +1167,7 @@ module AMQ
|
|
1167
1167
|
|
1168
1168
|
# @return
|
1169
1169
|
def self.decode(data)
|
1170
|
-
offset = 0
|
1170
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1171
1171
|
message_count = data[offset, 4].unpack(PACK_UINT32).first
|
1172
1172
|
offset += 4
|
1173
1173
|
self.new(message_count)
|
@@ -1222,7 +1222,7 @@ module AMQ
|
|
1222
1222
|
|
1223
1223
|
# @return
|
1224
1224
|
def self.decode(data)
|
1225
|
-
offset = 0
|
1225
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1226
1226
|
message_count = data[offset, 4].unpack(PACK_UINT32).first
|
1227
1227
|
offset += 4
|
1228
1228
|
self.new(message_count)
|
@@ -1277,7 +1277,7 @@ module AMQ
|
|
1277
1277
|
|
1278
1278
|
# @return
|
1279
1279
|
def self.decode(data)
|
1280
|
-
offset = 0
|
1280
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1281
1281
|
self.new()
|
1282
1282
|
end
|
1283
1283
|
|
@@ -1561,7 +1561,7 @@ module AMQ
|
|
1561
1561
|
|
1562
1562
|
# @return
|
1563
1563
|
def self.decode(data)
|
1564
|
-
offset = 0
|
1564
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1565
1565
|
self.new()
|
1566
1566
|
end
|
1567
1567
|
|
@@ -1616,7 +1616,7 @@ module AMQ
|
|
1616
1616
|
|
1617
1617
|
# @return
|
1618
1618
|
def self.decode(data)
|
1619
|
-
offset = 0
|
1619
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1620
1620
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
1621
1621
|
offset += 1
|
1622
1622
|
consumer_tag = data[offset, length]
|
@@ -1644,7 +1644,7 @@ module AMQ
|
|
1644
1644
|
|
1645
1645
|
# @return
|
1646
1646
|
def self.decode(data)
|
1647
|
-
offset = 0
|
1647
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1648
1648
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
1649
1649
|
offset += 1
|
1650
1650
|
consumer_tag = data[offset, length]
|
@@ -1687,7 +1687,7 @@ module AMQ
|
|
1687
1687
|
|
1688
1688
|
# @return
|
1689
1689
|
def self.decode(data)
|
1690
|
-
offset = 0
|
1690
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1691
1691
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
1692
1692
|
offset += 1
|
1693
1693
|
consumer_tag = data[offset, length]
|
@@ -1733,7 +1733,7 @@ module AMQ
|
|
1733
1733
|
bit_buffer = bit_buffer | (1 << 1) if immediate
|
1734
1734
|
buffer << [bit_buffer].pack(PACK_CHAR)
|
1735
1735
|
frames = [MethodFrame.new(buffer, channel)]
|
1736
|
-
properties,
|
1736
|
+
properties, _headers = self.split_headers(user_headers)
|
1737
1737
|
if properties.nil? or properties.empty?
|
1738
1738
|
raise RuntimeError.new("Properties can not be empty!")
|
1739
1739
|
end
|
@@ -1753,7 +1753,7 @@ module AMQ
|
|
1753
1753
|
|
1754
1754
|
# @return
|
1755
1755
|
def self.decode(data)
|
1756
|
-
offset = 0
|
1756
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1757
1757
|
reply_code = data[offset, 2].unpack(PACK_UINT16).first
|
1758
1758
|
offset += 2
|
1759
1759
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
@@ -1794,7 +1794,7 @@ module AMQ
|
|
1794
1794
|
|
1795
1795
|
# @return
|
1796
1796
|
def self.decode(data)
|
1797
|
-
offset = 0
|
1797
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1798
1798
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
1799
1799
|
offset += 1
|
1800
1800
|
consumer_tag = data[offset, length]
|
@@ -1866,7 +1866,7 @@ module AMQ
|
|
1866
1866
|
|
1867
1867
|
# @return
|
1868
1868
|
def self.decode(data)
|
1869
|
-
offset = 0
|
1869
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1870
1870
|
delivery_tag = AMQ::Pack.unpack_uint64_big_endian(data[offset, 8]).first
|
1871
1871
|
offset += 8
|
1872
1872
|
bit_buffer = data[offset, 1].unpack(PACK_CHAR).first
|
@@ -1909,7 +1909,7 @@ module AMQ
|
|
1909
1909
|
|
1910
1910
|
# @return
|
1911
1911
|
def self.decode(data)
|
1912
|
-
offset = 0
|
1912
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1913
1913
|
length = data[offset, 1].unpack(PACK_CHAR).first
|
1914
1914
|
offset += 1
|
1915
1915
|
cluster_id = data[offset, length]
|
@@ -1937,7 +1937,7 @@ module AMQ
|
|
1937
1937
|
|
1938
1938
|
# @return
|
1939
1939
|
def self.decode(data)
|
1940
|
-
offset = 0
|
1940
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
1941
1941
|
delivery_tag = AMQ::Pack.unpack_uint64_big_endian(data[offset, 8]).first
|
1942
1942
|
offset += 8
|
1943
1943
|
bit_buffer = data[offset, 1].unpack(PACK_CHAR).first
|
@@ -2047,7 +2047,7 @@ module AMQ
|
|
2047
2047
|
|
2048
2048
|
# @return
|
2049
2049
|
def self.decode(data)
|
2050
|
-
offset = 0
|
2050
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
2051
2051
|
self.new()
|
2052
2052
|
end
|
2053
2053
|
|
@@ -2069,7 +2069,7 @@ module AMQ
|
|
2069
2069
|
|
2070
2070
|
# @return
|
2071
2071
|
def self.decode(data)
|
2072
|
-
offset = 0
|
2072
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
2073
2073
|
delivery_tag = AMQ::Pack.unpack_uint64_big_endian(data[offset, 8]).first
|
2074
2074
|
offset += 8
|
2075
2075
|
bit_buffer = data[offset, 1].unpack(PACK_CHAR).first
|
@@ -2140,7 +2140,7 @@ module AMQ
|
|
2140
2140
|
|
2141
2141
|
# @return
|
2142
2142
|
def self.decode(data)
|
2143
|
-
offset = 0
|
2143
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
2144
2144
|
self.new()
|
2145
2145
|
end
|
2146
2146
|
|
@@ -2182,7 +2182,7 @@ module AMQ
|
|
2182
2182
|
|
2183
2183
|
# @return
|
2184
2184
|
def self.decode(data)
|
2185
|
-
offset = 0
|
2185
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
2186
2186
|
self.new()
|
2187
2187
|
end
|
2188
2188
|
|
@@ -2224,7 +2224,7 @@ module AMQ
|
|
2224
2224
|
|
2225
2225
|
# @return
|
2226
2226
|
def self.decode(data)
|
2227
|
-
offset = 0
|
2227
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
2228
2228
|
self.new()
|
2229
2229
|
end
|
2230
2230
|
|
@@ -2254,7 +2254,7 @@ module AMQ
|
|
2254
2254
|
|
2255
2255
|
# @return
|
2256
2256
|
def self.decode(data)
|
2257
|
-
offset = 0
|
2257
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
2258
2258
|
bit_buffer = data[offset, 1].unpack(PACK_CHAR).first
|
2259
2259
|
offset += 1
|
2260
2260
|
nowait = (bit_buffer & (1 << 0)) != 0
|
@@ -2290,7 +2290,7 @@ module AMQ
|
|
2290
2290
|
|
2291
2291
|
# @return
|
2292
2292
|
def self.decode(data)
|
2293
|
-
offset = 0
|
2293
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
2294
2294
|
self.new()
|
2295
2295
|
end
|
2296
2296
|
|
data/lib/amq/protocol/table.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# encoding: binary
|
2
2
|
|
3
|
-
require "amq/protocol/client"
|
4
3
|
require "amq/protocol/type_constants"
|
5
|
-
require "amq/protocol/table"
|
6
4
|
require "date"
|
7
5
|
|
8
6
|
require "amq/protocol/float_32bit"
|
@@ -31,10 +29,10 @@ module AMQ
|
|
31
29
|
accumulator << [value.bytesize].pack(PACK_UINT32)
|
32
30
|
accumulator << value
|
33
31
|
when Symbol then
|
34
|
-
|
32
|
+
str = value.to_s
|
35
33
|
accumulator << TYPE_STRING
|
36
|
-
accumulator << [
|
37
|
-
accumulator <<
|
34
|
+
accumulator << [str.bytesize].pack(PACK_UINT32)
|
35
|
+
accumulator << str
|
38
36
|
when Integer then
|
39
37
|
accumulator << TYPE_SIGNED_64BIT
|
40
38
|
accumulator << [value].pack(PACK_INT64_BE)
|
data/lib/amq/protocol/version.rb
CHANGED
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.1.0
|
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:
|
14
|
+
date: 2017-01-28 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
|
@@ -102,9 +102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project: amq-protocol
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.5.1
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: AMQP 0.9.1 encoding & decoding library.
|
109
109
|
test_files: []
|
110
|
-
has_rdoc:
|