amq-protocol 2.3.0 → 2.3.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 +5 -5
- data/.travis.yml +5 -3
- data/ChangeLog.md +17 -0
- data/Gemfile +1 -2
- data/README.md +7 -6
- data/amq-protocol.gemspec +0 -2
- data/lib/amq/protocol/client.rb +103 -30
- data/lib/amq/protocol/table_value_decoder.rb +1 -1
- data/lib/amq/protocol/version.rb +1 -1
- data/spec/amq/protocol/table_spec.rb +2 -2
- data/spec/amq/protocol/value_decoder_spec.rb +5 -5
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a7af862c42e7a7b3219c0f4eb107905aeeb8d88482c9b2463cfa40ee60aaffd5
|
4
|
+
data.tar.gz: d8e09e77cf744c2ee8975882b2bb624834abc58f48b91f6be9e65eecb1f148a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d3bdfaaaa6f26bc1bbc222f2a69a3ef23fbcbd8bbba097e70bbcbf6c25156c8dc2dea83f689c68e18f065691034c8e6d06d2a11fa2ebc9f5b12340a0b43c747
|
7
|
+
data.tar.gz: bd5f3501992a8aae522d160581b276e4f87df77613a13bafc5de13c9e5b229d79b41054b1f060ac91d9dc9fac72a8512453f3ce3d5cb7a2b56dc3a73209cb818
|
data/.travis.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
+
dist: bionic
|
1
2
|
language: ruby
|
2
3
|
bundler_args: --without development
|
3
4
|
cache: bundler
|
4
5
|
script: "bundle exec rspec spec"
|
5
6
|
rvm:
|
6
7
|
- ruby-head
|
7
|
-
- "2.
|
8
|
-
- "2.
|
9
|
-
- "2.
|
8
|
+
- "2.6.3"
|
9
|
+
- "2.5.5"
|
10
|
+
- "2.4.5"
|
11
|
+
- "2.3.8"
|
10
12
|
notifications:
|
11
13
|
recipients:
|
12
14
|
- michael@rabbitmq.com
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
## Changes between 2.3.1 and 2.3.2 (unreleased)
|
2
|
+
|
3
|
+
No changes yet.
|
4
|
+
|
5
|
+
|
6
|
+
## Changes between 2.3.0 and 2.3.1 (April 8th, 2020)
|
7
|
+
|
8
|
+
### Support for connection.update-secret
|
9
|
+
|
10
|
+
Used together with the `rabbitmq-auth-backend-oauth2` plugin.
|
11
|
+
|
12
|
+
### Squashed a gemspec Warning
|
13
|
+
|
14
|
+
GitHub issue: [ruby-amqp/amq-protocol#75](https://github.com/ruby-amqp/amq-protocol/issues/75).
|
15
|
+
|
16
|
+
|
17
|
+
|
1
18
|
## Changes between 2.2.0 and 2.3.0 (Jan 8th, 2018)
|
2
19
|
|
3
20
|
### Support for Additional URI Query Parameters
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,16 +1,17 @@
|
|
1
|
-
# What is amq-protocol
|
1
|
+
# What is amq-protocol
|
2
2
|
|
3
3
|
amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not an
|
4
|
-
AMQP client: amq-protocol only handles serialization and deserialization.
|
4
|
+
AMQP 0-9-1 client such as [Bunny](http://rubybunny.info): amq-protocol only handles serialization and deserialization.
|
5
5
|
|
6
|
-
If you want to write your own AMQP client, this gem will handle all the serialization
|
6
|
+
If you want to write your own AMQP 0-9-1 client, this gem will handle all the serialization
|
7
7
|
needs for you, including RabbitMQ extensions to AMQP 0.9.1.
|
8
8
|
|
9
9
|
|
10
10
|
## Supported Ruby Versions
|
11
11
|
|
12
|
-
amq-protocol `
|
13
|
-
amq-protocol `2.0.0` and later
|
12
|
+
* amq-protocol `2.3.0` only supports Ruby 2.2+.
|
13
|
+
* amq-protocol `2.0.0` through `2.2.0` and later supports Ruby 2.0+.
|
14
|
+
* amq-protocol `1.9.2` was the last version to support Ruby 1.8 and 1.9.
|
14
15
|
|
15
16
|
|
16
17
|
## Installation
|
@@ -46,7 +47,7 @@ amq-protocol is maintained by [Michael Klishin](https://github.com/michaelklishi
|
|
46
47
|
|
47
48
|
## CI Status
|
48
49
|
|
49
|
-
[](https://travis-ci.org/ruby-amqp/amq-protocol)
|
50
51
|
|
51
52
|
|
52
53
|
## Issues
|
data/amq-protocol.gemspec
CHANGED
data/lib/amq/protocol/client.rb
CHANGED
@@ -251,7 +251,7 @@ module AMQ
|
|
251
251
|
end
|
252
252
|
|
253
253
|
# @return
|
254
|
-
# ['client_properties = nil', "mechanism = 'PLAIN'", 'response = nil', "locale = 'en_US'"]
|
254
|
+
# [u'client_properties = nil', u"mechanism = u'PLAIN'", u'response = nil', u"locale = u'en_US'"]
|
255
255
|
def self.encode(client_properties, mechanism, response, locale)
|
256
256
|
channel = 0
|
257
257
|
buffer = @packed_indexes.dup
|
@@ -307,7 +307,7 @@ module AMQ
|
|
307
307
|
end
|
308
308
|
|
309
309
|
# @return
|
310
|
-
# ['response = nil']
|
310
|
+
# [u'response = nil']
|
311
311
|
def self.encode(response)
|
312
312
|
channel = 0
|
313
313
|
buffer = @packed_indexes.dup
|
@@ -362,7 +362,7 @@ module AMQ
|
|
362
362
|
end
|
363
363
|
|
364
364
|
# @return
|
365
|
-
# ['channel_max = false', 'frame_max = false', 'heartbeat = false']
|
365
|
+
# [u'channel_max = false', u'frame_max = false', u'heartbeat = false']
|
366
366
|
def self.encode(channel_max, frame_max, heartbeat)
|
367
367
|
channel = 0
|
368
368
|
buffer = @packed_indexes.dup
|
@@ -386,7 +386,7 @@ module AMQ
|
|
386
386
|
end
|
387
387
|
|
388
388
|
# @return
|
389
|
-
# ["virtual_host = '/'", 'capabilities = EMPTY_STRING', 'insist = false']
|
389
|
+
# [u"virtual_host = u'/'", u'capabilities = EMPTY_STRING', u'insist = false']
|
390
390
|
def self.encode(virtual_host)
|
391
391
|
capabilities = EMPTY_STRING
|
392
392
|
insist = false
|
@@ -467,7 +467,7 @@ module AMQ
|
|
467
467
|
end
|
468
468
|
|
469
469
|
# @return
|
470
|
-
# ['reply_code = nil', 'reply_text = EMPTY_STRING', 'class_id = nil', 'method_id = nil']
|
470
|
+
# [u'reply_code = nil', u'reply_text = EMPTY_STRING', u'class_id = nil', u'method_id = nil']
|
471
471
|
def self.encode(reply_code, reply_text, class_id, method_id)
|
472
472
|
channel = 0
|
473
473
|
buffer = @packed_indexes.dup
|
@@ -536,7 +536,7 @@ module AMQ
|
|
536
536
|
end
|
537
537
|
|
538
538
|
# @return
|
539
|
-
# ['reason = EMPTY_STRING']
|
539
|
+
# [u'reason = EMPTY_STRING']
|
540
540
|
def self.encode(reason)
|
541
541
|
channel = 0
|
542
542
|
buffer = @packed_indexes.dup
|
@@ -576,6 +576,79 @@ module AMQ
|
|
576
576
|
|
577
577
|
end
|
578
578
|
|
579
|
+
class UpdateSecret < Protocol::Method
|
580
|
+
@name = "connection.update-secret"
|
581
|
+
@method_id = 70
|
582
|
+
@index = 0x000A0046 # 10, 70, 655430
|
583
|
+
@packed_indexes = [10, 70].pack(PACK_UINT16_X2).freeze
|
584
|
+
|
585
|
+
# @return
|
586
|
+
def self.decode(data)
|
587
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
588
|
+
length = data[offset, 4].unpack(PACK_UINT32).first
|
589
|
+
offset += 4
|
590
|
+
new_secret = data[offset, length]
|
591
|
+
offset += length
|
592
|
+
length = data[offset, 1].unpack(PACK_CHAR).first
|
593
|
+
offset += 1
|
594
|
+
reason = data[offset, length]
|
595
|
+
offset += length
|
596
|
+
self.new(new_secret, reason)
|
597
|
+
end
|
598
|
+
|
599
|
+
attr_reader :new_secret, :reason
|
600
|
+
def initialize(new_secret, reason)
|
601
|
+
@new_secret = new_secret
|
602
|
+
@reason = reason
|
603
|
+
end
|
604
|
+
|
605
|
+
def self.has_content?
|
606
|
+
false
|
607
|
+
end
|
608
|
+
|
609
|
+
# @return
|
610
|
+
# [u'new_secret = nil', u'reason = nil']
|
611
|
+
def self.encode(new_secret, reason)
|
612
|
+
channel = 0
|
613
|
+
buffer = @packed_indexes.dup
|
614
|
+
buffer << [new_secret.to_s.bytesize].pack(PACK_UINT32)
|
615
|
+
buffer << new_secret.to_s
|
616
|
+
buffer << reason.to_s.bytesize.chr
|
617
|
+
buffer << reason.to_s
|
618
|
+
MethodFrame.new(buffer, channel)
|
619
|
+
end
|
620
|
+
|
621
|
+
end
|
622
|
+
|
623
|
+
class UpdateSecretOk < Protocol::Method
|
624
|
+
@name = "connection.update-secret-ok"
|
625
|
+
@method_id = 71
|
626
|
+
@index = 0x000A0047 # 10, 71, 655431
|
627
|
+
@packed_indexes = [10, 71].pack(PACK_UINT16_X2).freeze
|
628
|
+
|
629
|
+
# @return
|
630
|
+
def self.decode(data)
|
631
|
+
offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
|
632
|
+
self.new()
|
633
|
+
end
|
634
|
+
|
635
|
+
def initialize()
|
636
|
+
end
|
637
|
+
|
638
|
+
def self.has_content?
|
639
|
+
false
|
640
|
+
end
|
641
|
+
|
642
|
+
# @return
|
643
|
+
# []
|
644
|
+
def self.encode()
|
645
|
+
channel = 0
|
646
|
+
buffer = @packed_indexes.dup
|
647
|
+
MethodFrame.new(buffer, channel)
|
648
|
+
end
|
649
|
+
|
650
|
+
end
|
651
|
+
|
579
652
|
end
|
580
653
|
|
581
654
|
class Channel < Protocol::Class
|
@@ -596,7 +669,7 @@ module AMQ
|
|
596
669
|
end
|
597
670
|
|
598
671
|
# @return
|
599
|
-
# ['out_of_band = EMPTY_STRING']
|
672
|
+
# [u'out_of_band = EMPTY_STRING']
|
600
673
|
def self.encode(channel, out_of_band)
|
601
674
|
buffer = @packed_indexes.dup
|
602
675
|
buffer << out_of_band.to_s.bytesize.chr
|
@@ -659,7 +732,7 @@ module AMQ
|
|
659
732
|
end
|
660
733
|
|
661
734
|
# @return
|
662
|
-
# ['active = nil']
|
735
|
+
# [u'active = nil']
|
663
736
|
def self.encode(channel, active)
|
664
737
|
buffer = @packed_indexes.dup
|
665
738
|
bit_buffer = 0
|
@@ -695,7 +768,7 @@ module AMQ
|
|
695
768
|
end
|
696
769
|
|
697
770
|
# @return
|
698
|
-
# ['active = nil']
|
771
|
+
# [u'active = nil']
|
699
772
|
def self.encode(channel, active)
|
700
773
|
buffer = @packed_indexes.dup
|
701
774
|
bit_buffer = 0
|
@@ -741,7 +814,7 @@ module AMQ
|
|
741
814
|
end
|
742
815
|
|
743
816
|
# @return
|
744
|
-
# ['reply_code = nil', 'reply_text = EMPTY_STRING', 'class_id = nil', 'method_id = nil']
|
817
|
+
# [u'reply_code = nil', u'reply_text = EMPTY_STRING', u'class_id = nil', u'method_id = nil']
|
745
818
|
def self.encode(channel, reply_code, reply_text, class_id, method_id)
|
746
819
|
buffer = @packed_indexes.dup
|
747
820
|
buffer << [reply_code].pack(PACK_UINT16)
|
@@ -802,7 +875,7 @@ module AMQ
|
|
802
875
|
end
|
803
876
|
|
804
877
|
# @return
|
805
|
-
# ['ticket = 0', 'exchange = nil', "type = 'direct'", 'passive = false', 'durable = false', 'auto_delete = false', 'internal = false', 'nowait = false', 'arguments = {}']
|
878
|
+
# [u'ticket = 0', u'exchange = nil', u"type = u'direct'", u'passive = false', u'durable = false', u'auto_delete = false', u'internal = false', u'nowait = false', u'arguments = {}']
|
806
879
|
def self.encode(channel, exchange, type, passive, durable, auto_delete, internal, nowait, arguments)
|
807
880
|
ticket = 0
|
808
881
|
buffer = @packed_indexes.dup
|
@@ -858,7 +931,7 @@ module AMQ
|
|
858
931
|
end
|
859
932
|
|
860
933
|
# @return
|
861
|
-
# ['ticket = 0', 'exchange = nil', 'if_unused = false', 'nowait = false']
|
934
|
+
# [u'ticket = 0', u'exchange = nil', u'if_unused = false', u'nowait = false']
|
862
935
|
def self.encode(channel, exchange, if_unused, nowait)
|
863
936
|
ticket = 0
|
864
937
|
buffer = @packed_indexes.dup
|
@@ -908,7 +981,7 @@ module AMQ
|
|
908
981
|
end
|
909
982
|
|
910
983
|
# @return
|
911
|
-
# ['ticket = 0', 'destination = nil', 'source = nil', 'routing_key = EMPTY_STRING', 'nowait = false', 'arguments = {}']
|
984
|
+
# [u'ticket = 0', u'destination = nil', u'source = nil', u'routing_key = EMPTY_STRING', u'nowait = false', u'arguments = {}']
|
912
985
|
def self.encode(channel, destination, source, routing_key, nowait, arguments)
|
913
986
|
ticket = 0
|
914
987
|
buffer = @packed_indexes.dup
|
@@ -962,7 +1035,7 @@ module AMQ
|
|
962
1035
|
end
|
963
1036
|
|
964
1037
|
# @return
|
965
|
-
# ['ticket = 0', 'destination = nil', 'source = nil', 'routing_key = EMPTY_STRING', 'nowait = false', 'arguments = {}']
|
1038
|
+
# [u'ticket = 0', u'destination = nil', u'source = nil', u'routing_key = EMPTY_STRING', u'nowait = false', u'arguments = {}']
|
966
1039
|
def self.encode(channel, destination, source, routing_key, nowait, arguments)
|
967
1040
|
ticket = 0
|
968
1041
|
buffer = @packed_indexes.dup
|
@@ -1024,7 +1097,7 @@ module AMQ
|
|
1024
1097
|
end
|
1025
1098
|
|
1026
1099
|
# @return
|
1027
|
-
# ['ticket = 0', 'queue = EMPTY_STRING', 'passive = false', 'durable = false', 'exclusive = false', 'auto_delete = false', 'nowait = false', 'arguments = {}']
|
1100
|
+
# [u'ticket = 0', u'queue = EMPTY_STRING', u'passive = false', u'durable = false', u'exclusive = false', u'auto_delete = false', u'nowait = false', u'arguments = {}']
|
1028
1101
|
def self.encode(channel, queue, passive, durable, exclusive, auto_delete, nowait, arguments)
|
1029
1102
|
ticket = 0
|
1030
1103
|
buffer = @packed_indexes.dup
|
@@ -1090,7 +1163,7 @@ module AMQ
|
|
1090
1163
|
end
|
1091
1164
|
|
1092
1165
|
# @return
|
1093
|
-
# ['ticket = 0', 'queue = EMPTY_STRING', 'exchange = nil', 'routing_key = EMPTY_STRING', 'nowait = false', 'arguments = {}']
|
1166
|
+
# [u'ticket = 0', u'queue = EMPTY_STRING', u'exchange = nil', u'routing_key = EMPTY_STRING', u'nowait = false', u'arguments = {}']
|
1094
1167
|
def self.encode(channel, queue, exchange, routing_key, nowait, arguments)
|
1095
1168
|
ticket = 0
|
1096
1169
|
buffer = @packed_indexes.dup
|
@@ -1144,7 +1217,7 @@ module AMQ
|
|
1144
1217
|
end
|
1145
1218
|
|
1146
1219
|
# @return
|
1147
|
-
# ['ticket = 0', 'queue = EMPTY_STRING', 'nowait = false']
|
1220
|
+
# [u'ticket = 0', u'queue = EMPTY_STRING', u'nowait = false']
|
1148
1221
|
def self.encode(channel, queue, nowait)
|
1149
1222
|
ticket = 0
|
1150
1223
|
buffer = @packed_indexes.dup
|
@@ -1197,7 +1270,7 @@ module AMQ
|
|
1197
1270
|
end
|
1198
1271
|
|
1199
1272
|
# @return
|
1200
|
-
# ['ticket = 0', 'queue = EMPTY_STRING', 'if_unused = false', 'if_empty = false', 'nowait = false']
|
1273
|
+
# [u'ticket = 0', u'queue = EMPTY_STRING', u'if_unused = false', u'if_empty = false', u'nowait = false']
|
1201
1274
|
def self.encode(channel, queue, if_unused, if_empty, nowait)
|
1202
1275
|
ticket = 0
|
1203
1276
|
buffer = @packed_indexes.dup
|
@@ -1252,7 +1325,7 @@ module AMQ
|
|
1252
1325
|
end
|
1253
1326
|
|
1254
1327
|
# @return
|
1255
|
-
# ['ticket = 0', 'queue = EMPTY_STRING', 'exchange = nil', 'routing_key = EMPTY_STRING', 'arguments = {}']
|
1328
|
+
# [u'ticket = 0', u'queue = EMPTY_STRING', u'exchange = nil', u'routing_key = EMPTY_STRING', u'arguments = {}']
|
1256
1329
|
def self.encode(channel, queue, exchange, routing_key, arguments)
|
1257
1330
|
ticket = 0
|
1258
1331
|
buffer = @packed_indexes.dup
|
@@ -1540,7 +1613,7 @@ module AMQ
|
|
1540
1613
|
end
|
1541
1614
|
|
1542
1615
|
# @return
|
1543
|
-
# ['prefetch_size = false', 'prefetch_count = false', 'global = false']
|
1616
|
+
# [u'prefetch_size = false', u'prefetch_count = false', u'global = false']
|
1544
1617
|
def self.encode(channel, prefetch_size, prefetch_count, global)
|
1545
1618
|
buffer = @packed_indexes.dup
|
1546
1619
|
buffer << [prefetch_size].pack(PACK_UINT32)
|
@@ -1587,7 +1660,7 @@ module AMQ
|
|
1587
1660
|
end
|
1588
1661
|
|
1589
1662
|
# @return
|
1590
|
-
# ['ticket = 0', 'queue = EMPTY_STRING', 'consumer_tag = EMPTY_STRING', 'no_local = false', 'no_ack = false', 'exclusive = false', 'nowait = false', 'arguments = {}']
|
1663
|
+
# [u'ticket = 0', u'queue = EMPTY_STRING', u'consumer_tag = EMPTY_STRING', u'no_local = false', u'no_ack = false', u'exclusive = false', u'nowait = false', u'arguments = {}']
|
1591
1664
|
def self.encode(channel, queue, consumer_tag, no_local, no_ack, exclusive, nowait, arguments)
|
1592
1665
|
ticket = 0
|
1593
1666
|
buffer = @packed_indexes.dup
|
@@ -1666,7 +1739,7 @@ module AMQ
|
|
1666
1739
|
end
|
1667
1740
|
|
1668
1741
|
# @return
|
1669
|
-
# ['consumer_tag = nil', 'nowait = false']
|
1742
|
+
# [u'consumer_tag = nil', u'nowait = false']
|
1670
1743
|
def self.encode(channel, consumer_tag, nowait)
|
1671
1744
|
buffer = @packed_indexes.dup
|
1672
1745
|
buffer << consumer_tag.to_s.bytesize.chr
|
@@ -1719,7 +1792,7 @@ module AMQ
|
|
1719
1792
|
end
|
1720
1793
|
|
1721
1794
|
# @return
|
1722
|
-
# ['ticket = 0', 'exchange = EMPTY_STRING', 'routing_key = EMPTY_STRING', 'mandatory = false', 'immediate = false', 'user_headers = nil', 'payload = ""', 'frame_size = nil']
|
1795
|
+
# [u'ticket = 0', u'exchange = EMPTY_STRING', u'routing_key = EMPTY_STRING', u'mandatory = false', u'immediate = false', 'user_headers = nil', 'payload = ""', 'frame_size = nil']
|
1723
1796
|
def self.encode(channel, payload, user_headers, exchange, routing_key, mandatory, immediate, frame_size)
|
1724
1797
|
ticket = 0
|
1725
1798
|
buffer = @packed_indexes.dup
|
@@ -1843,7 +1916,7 @@ module AMQ
|
|
1843
1916
|
end
|
1844
1917
|
|
1845
1918
|
# @return
|
1846
|
-
# ['ticket = 0', 'queue = EMPTY_STRING', 'no_ack = false']
|
1919
|
+
# [u'ticket = 0', u'queue = EMPTY_STRING', u'no_ack = false']
|
1847
1920
|
def self.encode(channel, queue, no_ack)
|
1848
1921
|
ticket = 0
|
1849
1922
|
buffer = @packed_indexes.dup
|
@@ -1957,7 +2030,7 @@ module AMQ
|
|
1957
2030
|
end
|
1958
2031
|
|
1959
2032
|
# @return
|
1960
|
-
# ['delivery_tag = false', 'multiple = false']
|
2033
|
+
# [u'delivery_tag = false', u'multiple = false']
|
1961
2034
|
def self.encode(channel, delivery_tag, multiple)
|
1962
2035
|
buffer = @packed_indexes.dup
|
1963
2036
|
buffer << AMQ::Pack.pack_uint64_big_endian(delivery_tag)
|
@@ -1981,7 +2054,7 @@ module AMQ
|
|
1981
2054
|
end
|
1982
2055
|
|
1983
2056
|
# @return
|
1984
|
-
# ['delivery_tag = nil', 'requeue = true']
|
2057
|
+
# [u'delivery_tag = nil', u'requeue = true']
|
1985
2058
|
def self.encode(channel, delivery_tag, requeue)
|
1986
2059
|
buffer = @packed_indexes.dup
|
1987
2060
|
buffer << AMQ::Pack.pack_uint64_big_endian(delivery_tag)
|
@@ -2005,7 +2078,7 @@ module AMQ
|
|
2005
2078
|
end
|
2006
2079
|
|
2007
2080
|
# @return
|
2008
|
-
# ['requeue = false']
|
2081
|
+
# [u'requeue = false']
|
2009
2082
|
def self.encode(channel, requeue)
|
2010
2083
|
buffer = @packed_indexes.dup
|
2011
2084
|
bit_buffer = 0
|
@@ -2028,7 +2101,7 @@ module AMQ
|
|
2028
2101
|
end
|
2029
2102
|
|
2030
2103
|
# @return
|
2031
|
-
# ['requeue = false']
|
2104
|
+
# [u'requeue = false']
|
2032
2105
|
def self.encode(channel, requeue)
|
2033
2106
|
buffer = @packed_indexes.dup
|
2034
2107
|
bit_buffer = 0
|
@@ -2091,7 +2164,7 @@ module AMQ
|
|
2091
2164
|
end
|
2092
2165
|
|
2093
2166
|
# @return
|
2094
|
-
# ['delivery_tag = false', 'multiple = false', 'requeue = true']
|
2167
|
+
# [u'delivery_tag = false', u'multiple = false', u'requeue = true']
|
2095
2168
|
def self.encode(channel, delivery_tag, multiple, requeue)
|
2096
2169
|
buffer = @packed_indexes.dup
|
2097
2170
|
buffer << AMQ::Pack.pack_uint64_big_endian(delivery_tag)
|
@@ -2271,7 +2344,7 @@ module AMQ
|
|
2271
2344
|
end
|
2272
2345
|
|
2273
2346
|
# @return
|
2274
|
-
# ['nowait = false']
|
2347
|
+
# [u'nowait = false']
|
2275
2348
|
def self.encode(channel, nowait)
|
2276
2349
|
buffer = @packed_indexes.dup
|
2277
2350
|
bit_buffer = 0
|
@@ -125,7 +125,7 @@ module AMQ
|
|
125
125
|
def self.decode_big_decimal(data, offset)
|
126
126
|
decimals, raw = data.slice(offset, 5).unpack(PACK_UCHAR_UINT32)
|
127
127
|
offset += 5
|
128
|
-
v = BigDecimal
|
128
|
+
v = BigDecimal(raw.to_s) * (BigDecimal(TEN) ** -decimals)
|
129
129
|
|
130
130
|
[v, offset]
|
131
131
|
end # self.decode_big_decimal(data, offset)
|
data/lib/amq/protocol/version.rb
CHANGED
@@ -5,8 +5,8 @@ module AMQ
|
|
5
5
|
module Protocol
|
6
6
|
RSpec.describe Table do
|
7
7
|
timestamp = Time.utc(2010, 12, 31, 23, 58, 59)
|
8
|
-
bigdecimal_1 = BigDecimal
|
9
|
-
bigdecimal_2 = BigDecimal
|
8
|
+
bigdecimal_1 = BigDecimal("1.0")
|
9
|
+
bigdecimal_2 = BigDecimal("5E-3")
|
10
10
|
|
11
11
|
DATA = {
|
12
12
|
{} => "\x00\x00\x00\x00",
|
@@ -8,7 +8,7 @@ module AMQ
|
|
8
8
|
it "is capable of decoding basic arrays TableValueEncoder encodes" do
|
9
9
|
input1 = [1, 2, 3]
|
10
10
|
|
11
|
-
value,
|
11
|
+
value, _offset = described_class.decode_array(TableValueEncoder.encode(input1), 1)
|
12
12
|
expect(value.size).to eq(3)
|
13
13
|
expect(value.first).to eq(1)
|
14
14
|
expect(value).to eq(input1)
|
@@ -17,7 +17,7 @@ module AMQ
|
|
17
17
|
|
18
18
|
input2 = ["one", 2, "three"]
|
19
19
|
|
20
|
-
value,
|
20
|
+
value, _offset = described_class.decode_array(TableValueEncoder.encode(input2), 1)
|
21
21
|
expect(value.size).to eq(3)
|
22
22
|
expect(value.first).to eq("one")
|
23
23
|
expect(value).to eq(input2)
|
@@ -26,7 +26,7 @@ module AMQ
|
|
26
26
|
|
27
27
|
input3 = ["one", 2, "three", 4.0, 5000000.0]
|
28
28
|
|
29
|
-
value,
|
29
|
+
value, _offset = described_class.decode_array(TableValueEncoder.encode(input3), 1)
|
30
30
|
expect(value.size).to eq(5)
|
31
31
|
expect(value.last).to eq(5000000.0)
|
32
32
|
expect(value).to eq(input3)
|
@@ -42,7 +42,7 @@ module AMQ
|
|
42
42
|
# puts(TableValueEncoder.encode(input1).inspect)
|
43
43
|
|
44
44
|
|
45
|
-
value,
|
45
|
+
value, _offset = described_class.decode_array(data1, 1)
|
46
46
|
expect(value.size).to eq(2)
|
47
47
|
expect(value.first).to eq(Hash["one" => 2])
|
48
48
|
expect(value).to eq(input1)
|
@@ -51,7 +51,7 @@ module AMQ
|
|
51
51
|
|
52
52
|
input2 = ["one", 2, { "three" => { "four" => 5.0 } }]
|
53
53
|
|
54
|
-
value,
|
54
|
+
value, _offset = described_class.decode_array(TableValueEncoder.encode(input2), 1)
|
55
55
|
expect(value.size).to eq(3)
|
56
56
|
expect(value.last["three"]["four"]).to eq(5.0)
|
57
57
|
expect(value).to eq(input2)
|
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.3.
|
4
|
+
version: 2.3.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:
|
14
|
+
date: 2020-04-08 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
|
@@ -101,8 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
|
105
|
-
rubygems_version: 2.6.13
|
104
|
+
rubygems_version: 3.0.3
|
106
105
|
signing_key:
|
107
106
|
specification_version: 4
|
108
107
|
summary: AMQP 0.9.1 encoding & decoding library.
|