ezclient 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bbefbed2ebd4c6b412246062c09bf178b39b10b54631963e559fbb6d6150023
4
- data.tar.gz: 586fa332053ce325be892e05fb7eabfc7daecaf9c60a4aeae607d0fbb646366c
3
+ metadata.gz: 2eed245dc5cd1ca59aeda6408ae0b96747aa91fce6ba9770d37cb4cd68bced3b
4
+ data.tar.gz: 0b2503d2655fbbafa14ce64ce109aca3408fdb9fdaa92511d7627931eb5018b5
5
5
  SHA512:
6
- metadata.gz: d4e2142b3f825390f39dde75b2145da1485ba1211e2202639a0d88d5785373bbbf97e2dd4d8c12c0a4c7d4e0f57c927eec12300152ea757fd11ae6d33c019812
7
- data.tar.gz: bc99bcb243ea9c4c70e4916e8252fac60cdefbdbd136193a6b6db0611b5bfbb6609233ba3d5c0fa21f6775ada8354e07aa6e4c0bff488eec9516bbeb14a62e3e
6
+ metadata.gz: 819359caed5c59b4865ec5785b8369c7f851ef8b7a313e618b52ee45d9001bc8d1e02405df2b1d846e7038eb3c8945db4ad2b72b5c2b069c4d3149bcb1ea8aaf
7
+ data.tar.gz: c4374e5f61f5b76aa49f1c6d03fdaa9836bb67d08157ab99a8948c3a616229a96e024378ca102eda7b3fa37888ece5cca7af34ce233561166b7e47f6fd460ab3
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ inherit_gem:
3
3
 
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 2.3
6
+ TargetRubyVersion: 2.4
7
7
  Include:
8
8
  - bin/console
9
9
  - Gemfile
data/.travis.yml CHANGED
@@ -1,18 +1,16 @@
1
1
  language: ruby
2
+
2
3
  sudo: false
3
- cache: bundler
4
+
5
+ rvm:
6
+ - 2.4
7
+ - 2.5
8
+ - 2.6
9
+ - ruby-head
10
+
4
11
  before_install: gem install bundler
5
- env: SUITE="rspec"
6
- script: bundle exec $SUITE
12
+
7
13
  matrix:
8
14
  fast_finish: true
9
- include:
10
- - rvm: 2.3
11
- - rvm: 2.4
12
- - rvm: 2.5
13
- - rvm: 2.6
14
- - rvm: ruby-head
15
- - rvm: 2.6
16
- env: SUITE="rubocop"
17
15
  allow_failures:
18
16
  - rvm: ruby-head
data/README.md CHANGED
@@ -43,7 +43,7 @@ Valid client options are:
43
43
  - `on_retry` – callback called on request retry
44
44
  - `retry_exceptions` – an array of exception classes to retry
45
45
  - `ssl_context` – ssl context for requests (an `OpenSSL::SSL::SSLContext` instance)
46
- - `timeout` – timeout for requests in seconds
46
+ - `timeout` – timeout for requests in seconds or hash like `{ read: 5, write: 5, connect: 1 }`
47
47
  - `follow` - enable following redirects (`true` or hash with options – e.g. `{ max_hops: 1, strict: false}`)
48
48
 
49
49
  All these options are passed to each request made by this client but can be overriden on per-request basis.
data/Rakefile CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new(:lint)
7
9
 
8
- task default: :spec
10
+ task default: %i[lint spec]
data/ezclient.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require "ezclient/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.required_ruby_version = ">= 2.3.8"
8
+ spec.required_ruby_version = ">= 2.4.0"
9
9
 
10
10
  spec.name = "ezclient"
11
11
  spec.version = EzClient::VERSION
@@ -139,7 +139,12 @@ class EzClient::Request
139
139
  end
140
140
 
141
141
  def timeout
142
- options[:timeout]&.to_f
142
+ case options[:timeout]
143
+ when Hash
144
+ options[:timeout].transform_values! { |value| value&.to_f }
145
+ else
146
+ options[:timeout]&.to_f
147
+ end
143
148
  end
144
149
 
145
150
  def on_complete
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EzClient
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ezclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Smirnov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-26 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -174,14 +174,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
174
  requirements:
175
175
  - - ">="
176
176
  - !ruby/object:Gem::Version
177
- version: 2.3.8
177
+ version: 2.4.0
178
178
  required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  requirements:
180
180
  - - ">="
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  requirements: []
184
- rubygems_version: 3.0.3
184
+ rubygems_version: 3.0.6
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: An HTTP gem wrapper for easy persistent connections and more.