trailer_vote-api 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -9
- data/lib/trailer_vote/api/autoload.rb +1 -0
- data/lib/trailer_vote/api/version.rb +1 -1
- data/lib/trailer_vote/api/vista_config.rb +39 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e01c27fa31a17f396e67134cb37a50622d1fcac0262e0a4580ca6905e771db4
|
4
|
+
data.tar.gz: ae9800ce787139700512c9cb220ac2702326e0e1c2fc75bd14122cce9986aa06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ee8dc0ec742a59e883417176445738872a86b95006d343bb61269c0ffbfeef92bcbd8ef920a38818d6177443b5df6b608b83d973bbd7401b2d64c14e2a81827
|
7
|
+
data.tar.gz: 3ce1cb94ee6d459f9d322719e1ad918ba67a749067472d94fc0db958828216f3929de9e7641db39be602571389e13a9c4c85d3a6598648d7fcd92119bdfe9022
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trailer_vote-api (2.
|
4
|
+
trailer_vote-api (2.2.0)
|
5
5
|
http (>= 3.3.0, <= 4.1.1)
|
6
6
|
oj (>= 3.6, < 4.x)
|
7
7
|
trailer_vote-media_types (~> 2.0)
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
docile (1.3.2)
|
20
20
|
domain_name (0.5.20190701)
|
21
21
|
unf (>= 0.0.5, < 1.0.0)
|
22
|
-
hashdiff (1.0.
|
22
|
+
hashdiff (1.0.1)
|
23
23
|
http (4.1.1)
|
24
24
|
addressable (~> 2.3)
|
25
25
|
http-cookie (~> 1.0)
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
http_parser.rb (~> 0.6.0)
|
28
28
|
http-cookie (1.0.3)
|
29
29
|
domain_name (~> 0.5)
|
30
|
-
http-form_data (2.
|
30
|
+
http-form_data (2.3.0)
|
31
31
|
http_parser.rb (0.6.0)
|
32
32
|
media_types (0.6.2)
|
33
33
|
minitest (5.14.0)
|
@@ -38,21 +38,21 @@ GEM
|
|
38
38
|
builder
|
39
39
|
minitest (>= 5.0)
|
40
40
|
ruby-progressbar
|
41
|
-
oj (3.10.
|
41
|
+
oj (3.10.5)
|
42
42
|
public_suffix (4.0.3)
|
43
43
|
rake (13.0.1)
|
44
44
|
ruby-progressbar (1.10.1)
|
45
45
|
safe_yaml (1.0.5)
|
46
|
-
simplecov (0.18.
|
46
|
+
simplecov (0.18.5)
|
47
47
|
docile (~> 1.1)
|
48
|
-
simplecov-html (~> 0.11
|
49
|
-
simplecov-html (0.
|
50
|
-
trailer_vote-media_types (2.
|
48
|
+
simplecov-html (~> 0.11)
|
49
|
+
simplecov-html (0.12.2)
|
50
|
+
trailer_vote-media_types (2.4.0)
|
51
51
|
media_types (>= 0.6.0, < 1)
|
52
52
|
unf (0.1.4)
|
53
53
|
unf_ext
|
54
54
|
unf_ext (0.0.7.6)
|
55
|
-
webmock (3.8.
|
55
|
+
webmock (3.8.3)
|
56
56
|
addressable (>= 2.3.6)
|
57
57
|
crack (>= 0.3.2)
|
58
58
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'trailer_vote/media_types'
|
4
|
+
|
5
|
+
module TrailerVote
|
6
|
+
module Api
|
7
|
+
class VistaConfig
|
8
|
+
include Composable::Get
|
9
|
+
|
10
|
+
attr_accessor :client
|
11
|
+
|
12
|
+
SUCCESS = MediaTypes::VistaConfig.to_constructable.version(1)
|
13
|
+
FAILURE = MediaTypes::Errors.to_constructable.version(1)
|
14
|
+
ACCEPT = [SUCCESS.to_s, FAILURE.to_s(0.1)].join(', ').freeze
|
15
|
+
|
16
|
+
def initialize(configuration: nil, result: nil)
|
17
|
+
self.configuration = configuration
|
18
|
+
self.result = result
|
19
|
+
end
|
20
|
+
|
21
|
+
def call(url: nil)
|
22
|
+
return self if ok? || !url
|
23
|
+
|
24
|
+
local_client = client
|
25
|
+
unless client
|
26
|
+
uri = URI(url)
|
27
|
+
local_client = TrailerVote::Api.default_unauthenticated_client
|
28
|
+
local_client = local_client.basic_auth(user: uri.user, pass: uri.password)
|
29
|
+
end
|
30
|
+
|
31
|
+
guard_network_errors do
|
32
|
+
branch(local_client.headers(Headers::ACCEPT => ACCEPT).get(url))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
TrailerVote::MediaTypes::VistaConfig.register
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailer_vote-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derk-Jan Karrenbeld
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -227,6 +227,7 @@ files:
|
|
227
227
|
- lib/trailer_vote/api/push_recipe_ios.rb
|
228
228
|
- lib/trailer_vote/api/type_registry.rb
|
229
229
|
- lib/trailer_vote/api/version.rb
|
230
|
+
- lib/trailer_vote/api/vista_config.rb
|
230
231
|
- trailer_vote-api.gemspec
|
231
232
|
homepage: https://github.com/TrailerVote/trailervote-api-clients
|
232
233
|
licenses: []
|