antbird 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -6
- data/antbird.gemspec +1 -1
- data/lib/antbird/client.rb +7 -2
- data/lib/antbird/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0233525863b99bccb8734b00d5c92901924403113dd6bade6936ff566a00fa3a'
|
4
|
+
data.tar.gz: 00e9494e1a04c47adf6970bdc283a6854818186b112660c1830b9ada9370998c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0191b07ce7917e9d57bf2b96e75e4f45d735e578209fe8e093bdf2bab43b08f76a61c6150cbae034e7a723c248571bf68b22cedd2def7962aab06f7ad353063f'
|
7
|
+
data.tar.gz: ede40233ca26abddba033fe7c52920e3c8aa7167d1ab5bc27aad3bd1f2fd01305b9ce7aacaf16132759b79cc4ddacc99a53d6bec3bd52ad46e358433f5dcc6ef
|
data/README.md
CHANGED
@@ -50,13 +50,9 @@ client = Antbird::Client.new(
|
|
50
50
|
scope: {
|
51
51
|
index: 'test-index',
|
52
52
|
type: 'test-type'
|
53
|
-
}
|
53
|
+
},
|
54
|
+
adapter: :net_http_persistent
|
54
55
|
) do |f|
|
55
|
-
# https://github.com/lostisland/faraday/blob/master/docs/adapters/net_http_persistent.md
|
56
|
-
f.adapter :net_http_persistent, pool_size: 5 do |http|
|
57
|
-
http.idle_timeout = 100
|
58
|
-
end
|
59
|
-
|
60
56
|
# https://github.com/winebarrel/faraday_middleware-aws-sigv4
|
61
57
|
f.request(
|
62
58
|
:aws_sigv4,
|
data/antbird.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_dependency "faraday", "> 0.8", "< 2.0"
|
25
|
-
spec.add_dependency 'faraday_middleware', "> 0.12", "<
|
25
|
+
spec.add_dependency 'faraday_middleware', "> 0.12", "< 2.0"
|
26
26
|
|
27
27
|
spec.add_development_dependency "net-http-persistent"
|
28
28
|
spec.add_development_dependency "bundler", "> 1.16", "< 3.0"
|
data/lib/antbird/client.rb
CHANGED
@@ -10,10 +10,12 @@ module Antbird
|
|
10
10
|
version: nil,
|
11
11
|
read_timeout: 5,
|
12
12
|
open_timeout: 2,
|
13
|
+
adapter: ::Faraday.default_adapter,
|
13
14
|
&block)
|
14
15
|
|
15
16
|
@read_timeout = read_timeout
|
16
17
|
@open_timeout = open_timeout
|
18
|
+
@adapter = adapter
|
17
19
|
@block = block
|
18
20
|
@url = url
|
19
21
|
|
@@ -23,7 +25,7 @@ module Antbird
|
|
23
25
|
@api_specs = {}
|
24
26
|
end
|
25
27
|
attr_reader :scope, :url, :version
|
26
|
-
attr_reader :read_timeout, :open_timeout
|
28
|
+
attr_reader :read_timeout, :open_timeout, :adapter
|
27
29
|
attr_reader :api_specs
|
28
30
|
|
29
31
|
def scoped(new_scope = {})
|
@@ -149,12 +151,15 @@ module Antbird
|
|
149
151
|
|
150
152
|
def connection
|
151
153
|
@connection ||= Faraday.new(url) do |conn|
|
152
|
-
@block
|
154
|
+
@block&.call(conn)
|
155
|
+
|
153
156
|
conn.request :json
|
154
157
|
conn.response :json, content_type: /\bjson$/
|
155
158
|
|
156
159
|
conn.options[:timeout] = read_timeout
|
157
160
|
conn.options[:open_timeout] = open_timeout
|
161
|
+
|
162
|
+
conn.adapter adapter
|
158
163
|
end
|
159
164
|
end
|
160
165
|
|
data/lib/antbird/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: antbird
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '0.12'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '2.0'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '0.12'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '2.0'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: net-http-persistent
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|