etre-client 0.8.4 → 0.8.5
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 +5 -5
- data/lib/etre-client/client.rb +7 -3
- data/lib/etre-client/version.rb +1 -1
- data/spec/client_spec.rb +1 -1
- metadata +13 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7bb4311536146ce0c48e5a7c29ebdaac1b5280774c9b82b7f93e7be0bde54802
|
4
|
+
data.tar.gz: a991b597c0a26848422e358dd7ac1d949d61b4edd4e8b0b2d0590db66115d63c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 901d1d3f2e8692c6ccea5dea15a2f3e60fbcc86105c25124725369a14b68f57192e18a211b254d913afd6e9973f5286a7413be3dd50f40541e5074a8689336c7
|
7
|
+
data.tar.gz: 3cd429236b2b6dc3d79ef504cc3e637ba18681f7ff1966513f1ee25a970bd492b37adbc55cbead4d569d551d06a48f71d523c58bb3870f691b1ac877c2f32497
|
data/lib/etre-client/client.rb
CHANGED
@@ -11,11 +11,12 @@ module Etre
|
|
11
11
|
META_LABEL_ID = "_id"
|
12
12
|
META_LABEL_TYPE = "_type"
|
13
13
|
|
14
|
-
def initialize(entity_type:, url:, retry_count: 0, retry_wait: 1, options: {})
|
14
|
+
def initialize(entity_type:, url:, query_timeout: 5, retry_count: 0, retry_wait: 1, options: {})
|
15
15
|
@entity_type = entity_type
|
16
16
|
@url = url
|
17
|
+
@query_timeout = query_timeout # http request timeout in seconds
|
17
18
|
@retry_count = retry_count # retry count on network or API error
|
18
|
-
@retry_wait = retry_wait # wait time between retries
|
19
|
+
@retry_wait = retry_wait # wait time between retries in seconds
|
19
20
|
@options = options
|
20
21
|
|
21
22
|
@logger = Logger.new(STDOUT)
|
@@ -275,7 +276,10 @@ module Etre
|
|
275
276
|
end
|
276
277
|
|
277
278
|
def get_headers
|
278
|
-
{
|
279
|
+
{
|
280
|
+
:accept => 'application/json',
|
281
|
+
:x_etre_query_timeout => @query_timeout
|
282
|
+
}
|
279
283
|
end
|
280
284
|
|
281
285
|
def post_headers
|
data/lib/etre-client/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'ostruct'
|
|
3
3
|
|
4
4
|
describe Etre::Client do
|
5
5
|
let(:etre_client) { Etre::Client.new(entity_type: "node", url: "http://localhost:3000") }
|
6
|
-
let(:get_headers) { {:accept => "application/json"} }
|
6
|
+
let(:get_headers) { {:accept => "application/json", :x_etre_query_timeout => 5} }
|
7
7
|
let(:post_headers) { get_headers.merge({:content_type => "application/json"}) }
|
8
8
|
let(:put_headers) { post_headers }
|
9
9
|
let(:delete_headers) { get_headers }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etre-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Finch
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -42,22 +42,22 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '12.2'
|
48
45
|
- - ">="
|
49
46
|
- !ruby/object:Gem::Version
|
50
47
|
version: 12.2.0
|
48
|
+
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '12.2'
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- - "~>"
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: '12.2'
|
58
55
|
- - ">="
|
59
56
|
- !ruby/object:Gem::Version
|
60
57
|
version: 12.2.0
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '12.2'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '3.0'
|
75
|
-
description:
|
75
|
+
description:
|
76
76
|
email:
|
77
77
|
- mfinch@squareup.com
|
78
78
|
executables: []
|
@@ -98,7 +98,7 @@ homepage: https://github.com/square/etre-client-ruby
|
|
98
98
|
licenses:
|
99
99
|
- Apache-2.0
|
100
100
|
metadata: {}
|
101
|
-
post_install_message:
|
101
|
+
post_install_message:
|
102
102
|
rdoc_options: []
|
103
103
|
require_paths:
|
104
104
|
- lib
|
@@ -113,9 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
|
-
|
117
|
-
|
118
|
-
signing_key:
|
116
|
+
rubygems_version: 3.0.3
|
117
|
+
signing_key:
|
119
118
|
specification_version: 4
|
120
119
|
summary: Client gem for interacting with Etre
|
121
120
|
test_files:
|