amq-protocol 2.3.3 → 2.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49d61c5e0d929d97678b8c9f5b01c147c74f874a70481c7c24de865331ad8278
4
- data.tar.gz: efaeca2672afb7b1cd8eceb809bd8be9fcbfbecceb2e1893187b6fc9dcd2d5ff
3
+ metadata.gz: 90852fae30dd15d9f1f6ee5f9c0d98e856c3efcbd4c11e7e824caf63a01360f7
4
+ data.tar.gz: a000c7b2f435fc08f2d9c90a765f81e0414ca1c3038fcab1915ff7bcd4bdb929
5
5
  SHA512:
6
- metadata.gz: 12444b7175daf2d75f021e91eccb8782ebd11ec60855229bf82fa3e29792ba1ca8c96283723b8b5ffeaaf16ef6586b0b74948f605fb3526bed4146cff4030b0a
7
- data.tar.gz: 7d8c26b0e7a501515c1a130410c66d54ad7811c4e7cee15b02d894a8f46feacdc08f8456672e13b35df1f1ca738223c49721e545829c088079e28f96ebada1d8
6
+ metadata.gz: 718a613e5a2355791ef4d07bd38676b005cb00cd54969183a31eeba96cc3439ba223a8d9636050aa9aaf2ac5ca63150d3e3c53ce3e4638b53191097183b47ba3
7
+ data.tar.gz: 598de750f0c0ba6c838f4d1f34b4fb24f05b0a580c6b8beb7804d4edae437c628c18ac56d8ef87afc78ad56876ca4baafcf051f90f1eea9bb0cf3d48e993ea66
data/ChangeLog.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## Changes between 2.3.4 and 2.3.5 (in development)
2
+
3
+ No changes yet.
4
+
5
+
6
+ ## Changes between 2.3.3 and 2.3.4 (May 12, 2025)
7
+
8
+ ### (Forward) Compatibility with Ruby 3.5
9
+
10
+ Contributed by @Earlopain.
11
+
12
+ GitHub issue: [#80](https://github.com/ruby-amqp/amq-protocol/pull/80)
13
+
14
+
1
15
  ## Changes between 2.3.2 and 2.3.3 (February 17, 2025)
2
16
 
3
17
  ### Improved Compatibility with Ruby 3.4
@@ -1,5 +1,5 @@
1
1
  module AMQ
2
2
  module Protocol
3
- VERSION = "2.3.3"
3
+ VERSION = "2.3.4"
4
4
  end # Protocol
5
5
  end # AMQ
data/lib/amq/uri.rb CHANGED
@@ -1,6 +1,10 @@
1
1
  # encoding: utf-8
2
2
 
3
- require "cgi"
3
+ if RUBY_VERSION < "3.5"
4
+ require "cgi/util"
5
+ else
6
+ require "cgi/escape"
7
+ end
4
8
  require "uri"
5
9
 
6
10
  module AMQ
@@ -43,28 +47,33 @@ module AMQ
43
47
  end
44
48
 
45
49
  if uri.query
46
- query_params = CGI::parse(uri.query)
47
-
48
- normalized_query_params = Hash[query_params.map { |param, value| [param, value.one? ? value.first : value] }]
50
+ query_params = Hash.new { |hash, key| hash[key] = [] }
51
+ ::URI.decode_www_form(uri.query).each do |key, value|
52
+ query_params[key] << value
53
+ end
54
+ query_params.each do |key, value|
55
+ query_params[key] = value.one? ? value.first : value
56
+ end
57
+ query_params.default = nil
49
58
 
50
- opts[:heartbeat] = normalized_query_params["heartbeat"].to_i
51
- opts[:connection_timeout] = normalized_query_params["connection_timeout"].to_i
52
- opts[:channel_max] = normalized_query_params["channel_max"].to_i
53
- opts[:auth_mechanism] = normalized_query_params["auth_mechanism"]
59
+ opts[:heartbeat] = query_params["heartbeat"].to_i
60
+ opts[:connection_timeout] = query_params["connection_timeout"].to_i
61
+ opts[:channel_max] = query_params["channel_max"].to_i
62
+ opts[:auth_mechanism] = query_params["auth_mechanism"]
54
63
 
55
64
  %w(cacertfile certfile keyfile).each do |tls_option|
56
- if normalized_query_params[tls_option] && uri.scheme == "amqp"
65
+ if query_params[tls_option] && uri.scheme == "amqp"
57
66
  raise ArgumentError.new("The option '#{tls_option}' can only be used in URIs that use amqps schema")
58
67
  else
59
- opts[tls_option.to_sym] = normalized_query_params[tls_option]
68
+ opts[tls_option.to_sym] = query_params[tls_option]
60
69
  end
61
70
  end
62
71
 
63
72
  %w(verify fail_if_no_peer_cert).each do |tls_option|
64
- if normalized_query_params[tls_option] && uri.scheme == "amqp"
73
+ if query_params[tls_option] && uri.scheme == "amqp"
65
74
  raise ArgumentError.new("The option '#{tls_option}' can only be used in URIs that use amqps schema")
66
75
  else
67
- opts[tls_option.to_sym] = as_boolean(normalized_query_params[tls_option])
76
+ opts[tls_option.to_sym] = as_boolean(query_params[tls_option])
68
77
  end
69
78
  end
70
79
  end
@@ -80,7 +89,7 @@ module AMQ
80
89
  # Implementation
81
90
  #
82
91
 
83
- # Normalizes values returned by CGI.parse.
92
+ # Normalizes values returned by URI.decode_www_form.
84
93
  # @private
85
94
  def self.as_boolean(val)
86
95
  case val
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.3
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Stastny
@@ -10,7 +10,7 @@ authors:
10
10
  - Mark Abramov
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-02-17 00:00:00.000000000 Z
13
+ date: 2025-05-12 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: |2
16
16
  amq-protocol is an AMQP 0.9.1 serialization library for Ruby. It is not a