excon 0.98.0 → 0.99.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/excon/connection.rb +6 -0
- data/lib/excon/version.rb +1 -1
- data/lib/excon.rb +14 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4de69b0df9a1fc68f382e6d007845ddd9dac6ec8e6f0150b0988caafc604fc66
|
4
|
+
data.tar.gz: 3735d61f7219a99bfcfd8f953c7dd16f66b0232a794c602042f30a7eda7c9334
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 366bb5af60bbd24b607bb9306a5f1581e0daeb95881e33376e85a9a7892935758fb06c09d656f27ffd3f791fbcc372e9703bf738f08a10c5d46f06558a34e19e
|
7
|
+
data.tar.gz: a38b16b4e9fe30c66d75e96e39330f6661a3c4a906801e7eaade9c3efd4af8d86a804b224d264f777f8d13026c0c1dc18581120ce179c5bfd6cf8ae3e427cd10
|
data/lib/excon/connection.rb
CHANGED
@@ -62,6 +62,7 @@ module Excon
|
|
62
62
|
# @option params [Class] :instrumentor Responds to #instrument as in ActiveSupport::Notifications
|
63
63
|
# @option params [String] :instrumentor_name Name prefix for #instrument events. Defaults to 'excon'
|
64
64
|
def initialize(params = {})
|
65
|
+
@pid = Process.pid
|
65
66
|
@data = Excon.defaults.dup
|
66
67
|
# merge does not deep-dup, so make sure headers is not the original
|
67
68
|
@data[:headers] = @data[:headers].dup
|
@@ -480,6 +481,11 @@ module Excon
|
|
480
481
|
@_excon_sockets ||= {}
|
481
482
|
@_excon_sockets.compare_by_identity
|
482
483
|
|
484
|
+
if @pid != Process.pid
|
485
|
+
@_excon_sockets.clear # GC will take care of closing sockets
|
486
|
+
@pid = Process.pid
|
487
|
+
end
|
488
|
+
|
483
489
|
if @data[:thread_safe_sockets]
|
484
490
|
# In a multi-threaded world, if the same connection is used by multiple
|
485
491
|
# threads at the same time to connect to the same destination, they may
|
data/lib/excon/version.rb
CHANGED
data/lib/excon.rb
CHANGED
@@ -198,8 +198,13 @@ module Excon
|
|
198
198
|
headers_match = !stub.has_key?(:headers) || stub[:headers].keys.all? do |key|
|
199
199
|
case value = stub[:headers][key]
|
200
200
|
when Regexp
|
201
|
-
|
202
|
-
|
201
|
+
case request_params[:headers][key]
|
202
|
+
when String
|
203
|
+
if (match = value.match(request_params[:headers][key]))
|
204
|
+
captures[:headers][key] = match.captures
|
205
|
+
end
|
206
|
+
when Regexp # for unstub on regex params
|
207
|
+
match = (value == request_params[:headers][key])
|
203
208
|
end
|
204
209
|
match
|
205
210
|
else
|
@@ -209,8 +214,13 @@ module Excon
|
|
209
214
|
non_headers_match = (stub.keys - [:headers]).all? do |key|
|
210
215
|
case value = stub[key]
|
211
216
|
when Regexp
|
212
|
-
|
213
|
-
|
217
|
+
case request_params[key]
|
218
|
+
when String
|
219
|
+
if (match = value.match(request_params[key]))
|
220
|
+
captures[key] = match.captures
|
221
|
+
end
|
222
|
+
when Regexp # for unstub on regex params
|
223
|
+
match = (value == request_params[key])
|
214
224
|
end
|
215
225
|
match
|
216
226
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.99.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dpiddy (Dan Peterson)
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-02-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|