excon 1.3.0 → 1.5.0

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: 66ea34a2551ab2b6b952365fb9f01f215e403f36713bd9fed0c1acf5832a3186
4
- data.tar.gz: 8504fdb3abf428cb2bf34e6d25bfb8e8f8fffc9c412fabae0794b5040b256b51
3
+ metadata.gz: 5fea894ca265007d66dbec2fcd785d793fff59080175f64c268208d225e32a70
4
+ data.tar.gz: bdfe0c227062cc7560e5c8ca9ec4b5dabca2365443b50ab378312a38fc3c73d3
5
5
  SHA512:
6
- metadata.gz: 74a8ea0f546297a3d6b8e687dd08a97b578fd00ee1cbbe6fb9807fa05a4d011fb9cc1aa8eeb376283c45b5e3df39001984210ea07930ea9e981218074779db0d
7
- data.tar.gz: fc53331b8e605c199935cf79b3bbcdfd0a1e86b049905aa2257696191ad5931f047d83d3c99c3b599c12b42adb3d86aec0457aa28ff436e267d8fba8a15c69a2
6
+ metadata.gz: 3baf7973f3a75855cebac881fe5ff3bf28da851dc03900151454802cf2b57700dca2c08bf1f532fe43583ac27baa4e9b8fb0f66611bb3209e1a259e38e947a75
7
+ data.tar.gz: b087fedfedbfa0655eb2febab2705f2e699376ec6ec4974c42bd0d3dc55a068ccf7251b0b201f6e051c27b01334b2f1bea4d27cd6b1f5b7fea872b1401df40ae
data/README.md CHANGED
@@ -213,6 +213,19 @@ dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
213
213
  dns_resolver.timeouts = 3
214
214
  resolver = Resolv.new([Resolv::Hosts.new, dns_resolver])
215
215
  connection = Excon.new('http://geemus.com', :resolv_resolver => resolver)
216
+
217
+ # As an global alternative for Excon, you can configure a custom resolver
218
+ # factory which produces new resolver instances, configured to your likings.
219
+ # This even works with Ruby Ractors!
220
+ class CustomResolverFactory
221
+ # @return [Resolv] the new resolver instance
222
+ def self.create_resolver
223
+ dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
224
+ dns_resolver.timeouts = 3
225
+ Resolv.new([Resolv::Hosts.new, dns_resolver])
226
+ end
227
+ end
228
+ Excon.defaults[:resolver_factory] = CustomResolverFactory
216
229
  ```
217
230
 
218
231
  ## Chunked Requests
@@ -311,10 +324,10 @@ s.close
311
324
  The Unix socket will work for one-off requests and multiuse connections. A Unix socket path must be provided separate from the resource path.
312
325
 
313
326
  ```ruby
314
- connection = Excon.new('unix:///', :socket => '/tmp/unicorn.sock')
327
+ connection = Excon.new('unix:///', :socket => '/tmp/puma.sock')
315
328
  connection.request(:method => :get, :path => '/ping')
316
329
 
317
- Excon.get('unix:///ping', :socket => '/tmp/unicorn.sock')
330
+ Excon.get('unix:///ping', :socket => '/tmp/puma.sock')
318
331
  ```
319
332
 
320
333
  NOTE: Proxies will be ignored when using a Unix socket, since a Unix socket has to be local.