excon 0.109.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: 619c4a4efc7daf30961e09303c2618d592714ccacd16b8e2567592eb3517c68c
4
- data.tar.gz: bddecc90a89dc8af8b3bde08d75ade78a164b246b8de0c03df15b344613bb888
3
+ metadata.gz: 5fea894ca265007d66dbec2fcd785d793fff59080175f64c268208d225e32a70
4
+ data.tar.gz: bdfe0c227062cc7560e5c8ca9ec4b5dabca2365443b50ab378312a38fc3c73d3
5
5
  SHA512:
6
- metadata.gz: f5995d37357a44359685cf48946e30fcc4b2fb4f10ab8e6a818404554305bac72e6edf6b908baad25b7860d72141473c1b0d03f2d52ca24a90cc6585ec8dc7e1
7
- data.tar.gz: e7dd12e91db7c4c09ef2727c8fd1e49460cd591d4288f1a6e9b7693b3682bf6b96ff638fc51a082395b535e4381c7af667df49c782b00cd17ee0304f97e318ff
6
+ metadata.gz: 3baf7973f3a75855cebac881fe5ff3bf28da851dc03900151454802cf2b57700dca2c08bf1f532fe43583ac27baa4e9b8fb0f66611bb3209e1a259e38e947a75
7
+ data.tar.gz: b087fedfedbfa0655eb2febab2705f2e699376ec6ec4974c42bd0d3dc55a068ccf7251b0b201f6e051c27b01334b2f1bea4d27cd6b1f5b7fea872b1401df40ae
data/README.md CHANGED
@@ -4,8 +4,8 @@ Usable, fast, simple Ruby HTTP 1.1
4
4
 
5
5
  Excon was designed to be simple, fast and performant. It works great as a general HTTP(s) client and is particularly well suited to usage in API clients.
6
6
 
7
- [![Build Status](https://github.com/excon/excon/actions/workflows/ruby.yml/badge.svg)](https://github.com/excon/excon/actions/workflows/ruby.yml)
8
- [![Gem Version](https://badge.fury.io/rb/excon.svg)](https://badge.fury.io/rb/excon)
7
+ [![Build Status](https://github.com/excon/excon/actions/workflows/ci.yml/badge.svg)](https://github.com/excon/excon/actions/workflows/ci.yml)
8
+ [![Gem Version](https://badge.fury.io/rb/excon.svg)](https://rubygems.org/gems/excon)
9
9
 
10
10
  - [Getting Started](#getting-started)
11
11
  - [Options](#options)
@@ -190,6 +190,9 @@ connection.request(:timeout => 0.1) # timeout if the entire request takes longer
190
190
  #
191
191
  connection = Excon.new('http://geemus.com/', :tcp_nodelay => true)
192
192
 
193
+ # opt-in to having Excon add a default port (http:80 and https:443)
194
+ connection = Excon.new('http://geemus.com/', :include_default_port => true)
195
+
193
196
  # set longer connect_timeout (default is 60 seconds)
194
197
  connection = Excon.new('http://geemus.com/', :connect_timeout => 360)
195
198
 
@@ -210,6 +213,19 @@ dns_resolver = Resolv::DNS.new(nameserver: ['127.0.0.1'])
210
213
  dns_resolver.timeouts = 3
211
214
  resolver = Resolv.new([Resolv::Hosts.new, dns_resolver])
212
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
213
229
  ```
214
230
 
215
231
  ## Chunked Requests
@@ -308,10 +324,10 @@ s.close
308
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.
309
325
 
310
326
  ```ruby
311
- connection = Excon.new('unix:///', :socket => '/tmp/unicorn.sock')
327
+ connection = Excon.new('unix:///', :socket => '/tmp/puma.sock')
312
328
  connection.request(:method => :get, :path => '/ping')
313
329
 
314
- Excon.get('unix:///ping', :socket => '/tmp/unicorn.sock')
330
+ Excon.get('unix:///ping', :socket => '/tmp/puma.sock')
315
331
  ```
316
332
 
317
333
  NOTE: Proxies will be ignored when using a Unix socket, since a Unix socket has to be local.
@@ -509,6 +525,7 @@ Either of these should allow you to work around the socket error and continue wi
509
525
 
510
526
  ## Getting Help
511
527
 
528
+ - We support and test-against non-EOL Ruby versions. If you need older version support, please reach out.
512
529
  - Ask specific questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/excon).
513
530
  - Report bugs and discuss potential features in [Github issues](https://github.com/excon/excon/issues).
514
531