ezclient 0.4.0 → 0.5.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: 8095e9d89e1ba040935437e755e022ff458f09f16a99967a9def2059406a3448
4
- data.tar.gz: 23ba78d9d72e9ce7dbbda36a66be93cb6a4d5f9948bc71d42f7cdbb0f52c36d3
3
+ metadata.gz: 36276a0601968419be332b235a0bacd0d8687a36b318d0d3351d4b431ef58f92
4
+ data.tar.gz: 58e5d7f226a2c9792229212329bf0cea4f73b0712bf70d0a0ddb4df93f2cfb24
5
5
  SHA512:
6
- metadata.gz: 5eeec168072569e4bf30602b58315111bad499b91b242b5ac66ea28f59ed2e8214b2209d78e0eace3d36ede29676656a1a652a70fb2b4a03536a2a17001c69d8
7
- data.tar.gz: 5407977b45b49797bc7eaf75f2b8458ec84be9c9cfca3d3c313dc71f6a0916c3908b76988b4e9d894bf2987dd2b24088d59fe092e0c3b4d1b411f316048bf4f2
6
+ metadata.gz: f9fddb90bf2bbf7fcfa337a9ca13f734e8330329345375679d3b2102012fd10f1d2abe1cc23498cdd3a66ba1ea85edbcdedb503c5c6753d9c18228ccaede9285
7
+ data.tar.gz: 81cc96427b233facb25ca58542aa569ae304b6ba95e42b6f6a475b63013bb7ff032c26fa5b3ac6ed786ea9d4f314dd9ec80a16933b5bb259f7b14dd15a779f51
data/.rubocop.yml CHANGED
@@ -4,3 +4,5 @@ inherit_gem:
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
6
  TargetRubyVersion: 2.5
7
+ Exclude:
8
+ - vendor/**/*
data/.travis.yml CHANGED
@@ -1,15 +1,27 @@
1
- sudo: false
2
1
  language: ruby
2
+
3
+ sudo: false
4
+
3
5
  rvm:
4
6
  - 2.3.5
5
7
  - 2.4.2
6
8
  - 2.5.0
7
- before_install: gem install bundler -v 1.16.1
9
+ - ruby-head
10
+
11
+ before_install: gem install bundler
12
+
8
13
  env: SUITE="rspec"
14
+
9
15
  script: bundle exec $SUITE
16
+
10
17
  matrix:
11
18
  fast_finish: true
12
19
  # Only run RuboCop on the latest Ruby
13
20
  include:
14
21
  - rvm: 2.5.0
15
22
  env: SUITE="rubocop"
23
+ allow_failures:
24
+ - rvm: ruby-head
25
+ - rvm: jruby-head
26
+
27
+ cache: bundler
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class EzClient
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
data/lib/ezclient.rb CHANGED
@@ -12,7 +12,10 @@ class EzClient
12
12
  end
13
13
 
14
14
  def request(verb, url, **options)
15
+ options = { **default_options, **options }
16
+
15
17
  keep_alive_timeout = options.delete(:keep_alive)
18
+ api_auth = options.delete(:api_auth)
16
19
 
17
20
  if keep_alive_timeout
18
21
  client = persistent_client_for(url, timeout: keep_alive_timeout)
@@ -20,7 +23,9 @@ class EzClient
20
23
  client = HTTP::Client.new
21
24
  end
22
25
 
23
- Request.new(verb, url, client: client, **default_options, **options)
26
+ Request.new(verb, url, client: client, **options).tap do |request|
27
+ request.api_auth!(*api_auth) if api_auth
28
+ end
24
29
  end
25
30
 
26
31
  private
@@ -34,11 +39,13 @@ class EzClient
34
39
 
35
40
  def default_options
36
41
  {
42
+ api_auth: options[:api_auth],
43
+ keep_alive: options[:keep_alive],
44
+ max_retries: options[:max_retries],
37
45
  on_complete: options[:on_complete],
38
46
  on_error: options[:on_error],
39
- timeout: options[:default_timeout],
40
47
  retry_exceptions: options[:retry_exceptions],
41
- max_retries: options[:max_retries],
48
+ timeout: options[:default_timeout],
42
49
  }
43
50
  end
44
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ezclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Smirnov
@@ -151,8 +151,6 @@ files:
151
151
  - LICENSE.txt
152
152
  - README.md
153
153
  - Rakefile
154
- - bin/console
155
- - bin/setup
156
154
  - ezclient.gemspec
157
155
  - lib/ezclient.rb
158
156
  - lib/ezclient/request.rb
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "ezclient"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here