http-client 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -0
  3. data/README.md +5 -0
  4. data/lib/http/client.rb +11 -3
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f4a112248d92e2509e0216202710ecf2f4b7d0e
4
- data.tar.gz: 79dacb1979e38cdcd9e56595e06d9d7e5faaabd1
3
+ metadata.gz: 9f0bd131d91055ba88ef419e2320e73f7c22a736
4
+ data.tar.gz: 921c11271d7aaebc44df64c5f40fa04de5f6c084
5
5
  SHA512:
6
- metadata.gz: 884c171d1b1329d12542601a2380e9079dd2eb52c0e92620d51810d6789b8c803c6bf2c2e244f80b21c34b3ec6d9ab229a7632340cb5491cfdbda54de0d84ea9
7
- data.tar.gz: 39f076f5abcf0b6a5cde2400be1c4c3b33f3447c956e01f46855fef49d4d85fc1a9f27cae4bd2a00ea9f0f3cc7c238bcab897cc160d41dcafe4dedf9a2bfaa28
6
+ metadata.gz: 5ba43b3fe0dd4c2cfb45c7a5095597b88e3da82d032e9795990a9cef3ab6e606c135457cd8093b05e02986fdba0369637d993fa8196c1312184bfebed47083d2
7
+ data.tar.gz: 871bbed57899b5e40bc42715f3068a5368c2baf04a485796a0e2cc04633633439d7ac38fcce4f2edde473995015a0610111751d888f9c474af5b4763824e50f7
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.6.0 (2019-04-05)
2
+
3
+ * Accessors to set default global timeouts for Net::HTTP.
4
+
1
5
  == 0.5.0 (2018-08-20)
2
6
 
3
7
  * Handle basic auth credentials passed in URI.
data/README.md CHANGED
@@ -33,6 +33,11 @@ HTTP::Client
33
33
  .delete(uri, arguments = {})
34
34
  .options(uri, arguments = {})
35
35
 
36
+ HTTP::Client
37
+ .open_timeout=
38
+ .read_timeout=
39
+ .ssl_timeout=
40
+
36
41
  HTTP::Client::Request
37
42
  .new(verb, uri, arguments = {})
38
43
  #execute
@@ -9,7 +9,7 @@ require 'zlib'
9
9
 
10
10
  module HTTP
11
11
  module Client
12
- VERSION = '0.5.0'
12
+ VERSION = '0.6.0'
13
13
 
14
14
  GET = Net::HTTP::Get
15
15
  HEAD = Net::HTTP::Head
@@ -22,6 +22,10 @@ module HTTP
22
22
  SSL_VERIFY_NONE = OpenSSL::SSL::VERIFY_NONE
23
23
  SSL_VERIFY_PEER = OpenSSL::SSL::VERIFY_PEER
24
24
 
25
+ class << self
26
+ attr_accessor :open_timeout, :ssl_timeout, :read_timeout
27
+ end
28
+
25
29
  class Request
26
30
  VALID_PARAMETERS = %w(headers files query body auth timeout open_timeout ssl_timeout read_timeout max_redirects ssl_verify jar)
27
31
  DEFAULT_HEADERS = {'User-Agent' => 'HTTP Client API/1.0'}
@@ -100,17 +104,21 @@ module HTTP
100
104
  @delegate.basic_auth(uri.user, uri.password)
101
105
  end
102
106
 
107
+ @open_timeout = HTTP::Client.open_timeout
108
+ @read_timeout = HTTP::Client.read_timeout
109
+ @ssl_timeout = HTTP::Client.ssl_timeout
110
+
103
111
  # generic timeout
104
112
  if timeout = args[:timeout]
105
113
  @open_timeout = timeout
106
- @ssl_timeout = timeout
107
114
  @read_timeout = timeout
115
+ @ssl_timeout = timeout
108
116
  end
109
117
 
110
118
  # overrides
111
119
  @open_timeout = args[:open_timeout] if args[:open_timeout]
112
- @ssl_timeout = args[:ssl_timeout] if args[:ssl_timeout]
113
120
  @read_timeout = args[:read_timeout] if args[:read_timeout]
121
+ @ssl_timeout = args[:ssl_timeout] if args[:ssl_timeout]
114
122
 
115
123
  @max_redirects = args.fetch(:max_redirects, 0)
116
124
  @ssl_verify = args.fetch(:ssl_verify, SSL_VERIFY_PEER)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bharanee Rathna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2019-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types