zaikio-client-helpers 0.2.3 → 0.2.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d00d304ca27fb927748ae92d163e44c1254a6a9b6c7cd2616fdc32e8cd08dc38
|
4
|
+
data.tar.gz: cbbe9e8df3357f9e1bfdb7defc4e14d20808add68608138d60684e2af78b2e08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24eebf4cafa1afd04326db5f23b2d8518e2c1633607e5d8c54bcdf768b576ac5e7b3a266ac495c85ab73e6f167dfca7b545d41d802f3fd6777e8df417af35590
|
7
|
+
data.tar.gz: 51c4e0d201584c3d0701bffb3942a219d2d40312f946f4b75b11e43ccf00acc06369553b8ee6bdef182766f07137b38e52ef6520e4319c8e33ee55f44d008753
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,13 @@ require "faraday"
|
|
2
2
|
require "multi_json"
|
3
3
|
|
4
4
|
module Zaikio::Client::Helpers
|
5
|
-
|
5
|
+
superclass = if Gem.loaded_specs["faraday"].version >= Gem::Version.new("2.0")
|
6
|
+
Faraday::Middleware
|
7
|
+
else
|
8
|
+
Faraday::Response::Middleware
|
9
|
+
end
|
10
|
+
|
11
|
+
JSONParser = Class.new(superclass) do
|
6
12
|
def on_complete(env)
|
7
13
|
case env.status
|
8
14
|
when 404 then raise Spyke::ResourceNotFound.new(nil, url: env.url)
|
@@ -11,6 +11,12 @@ module Zaikio::Client::Helpers
|
|
11
11
|
|
12
12
|
METADATA_KEY = :pagination
|
13
13
|
|
14
|
+
superclass = if Gem.loaded_specs["faraday"].version >= Gem::Version.new("2.0")
|
15
|
+
Faraday::Middleware
|
16
|
+
else
|
17
|
+
Faraday::Response::Middleware
|
18
|
+
end
|
19
|
+
|
14
20
|
# Faraday Middleware for extracting any pagination headers into the a top-level
|
15
21
|
# :metadata hash, or the env hash for non-JSON responses.
|
16
22
|
#
|
@@ -22,7 +28,7 @@ module Zaikio::Client::Helpers
|
|
22
28
|
# response = conn.get("/")
|
23
29
|
# response.env[METADATA_KEY]
|
24
30
|
# #=> {total_count: 4, total_pages: 1, current_page: 1}
|
25
|
-
|
31
|
+
FaradayMiddleware = Class.new(superclass) do
|
26
32
|
def on_complete(env)
|
27
33
|
@env = env
|
28
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaikio-client-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zaikio GMBH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
29
|
+
version: '1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: multi_json
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +48,16 @@ dependencies:
|
|
42
48
|
name: spyke
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- - "
|
51
|
+
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '6'
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
|
-
- - "
|
58
|
+
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '6'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: vcr
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|