wordpress-json-api 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/wordpress/json/api/client.rb +5 -5
- data/lib/wordpress/json/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 397f99439117f41811990fae15cb68192110075b9dbb5d6420e9b6bf7a94765e
|
4
|
+
data.tar.gz: 13c448ab73299a935bf2c4f88452d0d79a397d20f844c52518398be7e12e94be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e41cb1d36cc1e4999451298d49da6aca39a13f4773e4c2ab31a56caa0f1a8b684c40c850f34484ff48f9a88569ccfc6f4d7e811c21af23a0de6b035be6a6921c
|
7
|
+
data.tar.gz: 295a259463fe2213727209ce17fa72fdc503d65a9aa50c9b531fd2aa74a7576e93b3510f3e5337578985198b664e13b96a059a991e071a59bc51aa751104b8e6
|
data/Gemfile.lock
CHANGED
@@ -56,21 +56,21 @@ module Wordpress
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def request(path, params: {}, headers: {}, retries: 3)
|
59
|
-
|
59
|
+
response = nil
|
60
60
|
|
61
61
|
begin
|
62
|
-
resp
|
62
|
+
resp = self.connection.get(path) do |request|
|
63
63
|
request.headers = connection.headers.merge(headers) if headers && !headers.empty?
|
64
64
|
request.params = params if params && !params.empty?
|
65
65
|
end
|
66
66
|
|
67
|
-
|
67
|
+
response = process_response(resp)
|
68
68
|
rescue => exception
|
69
69
|
retries -= 1
|
70
70
|
retry if retries > 0
|
71
71
|
end
|
72
72
|
|
73
|
-
return
|
73
|
+
return response
|
74
74
|
end
|
75
75
|
|
76
76
|
def all(path, params: {}, headers: {})
|
@@ -102,7 +102,7 @@ module Wordpress
|
|
102
102
|
return responses
|
103
103
|
end
|
104
104
|
|
105
|
-
def
|
105
|
+
def process_response(resp)
|
106
106
|
if resp.success?
|
107
107
|
body = resp&.body
|
108
108
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordpress-json-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Johnsson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|