reso_api 0.5.1 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reso_api/app/models/reso/api/client.rb +5 -2
- data/lib/reso_api/version.rb +1 -1
- data/license.md +21 -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: 73aa7cfde3a1c862ae24af151a7e179e56f7765d5f71a54fee103a4ef2963750
|
4
|
+
data.tar.gz: 9949c7a9f28e1c2e54a3ae3ad4aed9657ddab43650a28fccf162d5426aa83b71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e92d18c780a60e380993082eb42a8cc81b7612800fa0cc87979a32bb5a4f203256c9452cdedef53c88f9e6da6245796e4c6e82b8b967fec570303f3776dc3e6e
|
7
|
+
data.tar.gz: 4858d6e61f634d7e03dfcf49ed49080645a3084f5c884e37ea1a1935641a193c6c815713fe2fbdefd33fea15ab01514318ca1adefc5b41a9ace65f067f5b4dd1
|
@@ -130,7 +130,7 @@ module RESO
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def fresh_oauth2_payload
|
133
|
-
@oauth2_payload = oauth2_client.client_credentials.get_token
|
133
|
+
@oauth2_payload = oauth2_client.client_credentials.get_token('client_id' => client_id, 'client_secret' => client_secret)
|
134
134
|
File.write(oauth2_token_path, @oauth2_payload.to_hash.to_json)
|
135
135
|
return @oauth2_payload
|
136
136
|
end
|
@@ -148,7 +148,7 @@ module RESO
|
|
148
148
|
persisted = File.read(oauth2_token_path)
|
149
149
|
payload = OAuth2::AccessToken.from_hash(oauth2_client, JSON.parse(persisted))
|
150
150
|
else
|
151
|
-
payload = oauth2_client.client_credentials.get_token
|
151
|
+
payload = oauth2_client.client_credentials.get_token('client_id' => client_id, 'client_secret' => client_secret)
|
152
152
|
File.write(oauth2_token_path, payload.to_hash.to_json)
|
153
153
|
end
|
154
154
|
return payload
|
@@ -180,6 +180,9 @@ module RESO
|
|
180
180
|
raise StandardError
|
181
181
|
elsif response.is_a?(Hash) && response.has_key?("error")
|
182
182
|
raise StandardError
|
183
|
+
elsif response.is_a?(Hash) && response.has_key?("retry-after")
|
184
|
+
sleep response["retry-after"].to_i
|
185
|
+
raise StandardError
|
183
186
|
end
|
184
187
|
rescue Net::ReadTimeout, StandardError
|
185
188
|
if (retries += 1) <= 5
|
data/lib/reso_api/version.rb
CHANGED
data/license.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Michael Edlund
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reso_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Edlund
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/reso_api/app/models/reso/api/client.rb
|
104
104
|
- lib/reso_api/config/inflections.rb
|
105
105
|
- lib/reso_api/version.rb
|
106
|
+
- license.md
|
106
107
|
- reso_api.gemspec
|
107
108
|
homepage: https://github.com/arcticleo/reso_api
|
108
109
|
licenses: []
|